Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / faxQueueReport / faxQueueReport.controller.js
index dac701b..5949442 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03cb=['hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','params','intersection','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../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','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length'];(function(_0xb07ec8,_0x4ec78b){var _0x56cf8c=function(_0x3d8d96){while(--_0x3d8d96){_0xb07ec8['push'](_0xb07ec8['shift']());}};_0x56cf8c(++_0x4ec78b);}(_0x03cb,0xab));var _0xb03c=function(_0x120482,_0x321bb0){_0x120482=_0x120482-0x0;var _0x13efef=_0x03cb[_0x120482];return _0x13efef;};'use strict';var pdf=require(_0xb03c('0x0'));var emlformat=require(_0xb03c('0x1'));var rimraf=require(_0xb03c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb03c('0x3'));var moment=require('moment');var BPromise=require(_0xb03c('0x4'));var Mustache=require(_0xb03c('0x5'));var util=require(_0xb03c('0x6'));var path=require('path');var sox=require(_0xb03c('0x7'));var csv=require('to-csv');var ejs=require(_0xb03c('0x8'));var fs=require('fs');var _=require(_0xb03c('0x9'));var squel=require('squel');var crypto=require(_0xb03c('0xa'));var jsforce=require(_0xb03c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb03c('0xc'));var Papa=require(_0xb03c('0xd'));var Redis=require(_0xb03c('0xe'));var authService=require(_0xb03c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb03c('0x10'));var hardwareService=require(_0xb03c('0x11'));var logger=require(_0xb03c('0x12'))(_0xb03c('0x13'));var utils=require(_0xb03c('0x14'));var config=require(_0xb03c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1299fc,_0x1501cd){_0x1501cd=_0x1501cd||0xcc;return function(_0x52a7b6){if(_0x52a7b6){return _0x1299fc[_0xb03c('0x16')](_0x1501cd);}return _0x1299fc[_0xb03c('0x17')](_0x1501cd)[_0xb03c('0x18')]();};}function respondWithResult(_0x4cc429,_0x2e0c12){_0x2e0c12=_0x2e0c12||0xc8;return function(_0x3d0e59){if(_0x3d0e59){return _0x4cc429[_0xb03c('0x17')](_0x2e0c12)[_0xb03c('0x19')](_0x3d0e59);}};}function respondWithFilteredResult(_0x22cf27,_0x5e8a97){return function(_0x2a5370){if(_0x2a5370){var _0xd615fe=_0x2a5370[_0xb03c('0x1a')],_0x47c76f=_0x5e8a97[_0xb03c('0x1b')],_0x1b1719=_0x5e8a97[_0xb03c('0x1b')]+_0x5e8a97[_0xb03c('0x1c')],_0x3d9cb7;if(_0x1b1719>=_0xd615fe){_0x1b1719=_0xd615fe;_0x3d9cb7=0xc8;}else{_0x3d9cb7=0xce;}_0x22cf27['status'](_0x3d9cb7);return _0x22cf27[_0xb03c('0x1d')]('Content-Range',_0x47c76f+'-'+_0x1b1719+'/'+_0xd615fe)[_0xb03c('0x19')](_0x2a5370);}return null;};}function patchUpdates(_0xfed606){return function(_0x204ea1){try{jsonpatch[_0xb03c('0x1e')](_0x204ea1,_0xfed606,!![]);}catch(_0x3a02a7){return BPromise[_0xb03c('0x1f')](_0x3a02a7);}return _0x204ea1[_0xb03c('0x20')]();};}function saveUpdates(_0x190dd3,_0x32e62c){return function(_0x2ee811){if(_0x2ee811){return _0x2ee811[_0xb03c('0x21')](_0x190dd3)[_0xb03c('0x22')](function(_0x4e3ca6){return _0x4e3ca6;});}return null;};}function removeEntity(_0x1cdb6e,_0x37e11e){return function(_0x11d536){if(_0x11d536){return _0x11d536[_0xb03c('0x23')]()[_0xb03c('0x22')](function(){_0x1cdb6e['status'](0xcc)[_0xb03c('0x18')]();});}};}function handleEntityNotFound(_0x2f8da2,_0x5b59b5){return function(_0x5893f6){if(!_0x5893f6){_0x2f8da2[_0xb03c('0x16')](0x194);}return _0x5893f6;};}function handleError(_0x25acf2,_0x2d4dca){_0x2d4dca=_0x2d4dca||0x1f4;return function(_0x37f668){logger[_0xb03c('0x24')](_0x37f668[_0xb03c('0x25')]);if(_0x37f668['name']){delete _0x37f668[_0xb03c('0x26')];}_0x25acf2[_0xb03c('0x17')](_0x2d4dca)[_0xb03c('0x27')](_0x37f668);};}exports[_0xb03c('0x28')]=function(_0x485349,_0x5a50b4){var _0x217934={},_0x30ce64={},_0x42c6d2={'count':0x0,'rows':[]};var _0x1ede9d=_[_0xb03c('0x29')](db[_0xb03c('0x2a')][_0xb03c('0x2b')],function(_0x2150a0){return{'name':_0x2150a0[_0xb03c('0x2c')],'type':_0x2150a0[_0xb03c('0x2d')][_0xb03c('0x2e')]};});_0x30ce64[_0xb03c('0x2f')]=_[_0xb03c('0x29')](_0x1ede9d,'name');_0x30ce64['query']=_[_0xb03c('0x30')](_0x485349[_0xb03c('0x31')]);_0x30ce64[_0xb03c('0x32')]=_['intersection'](_0x30ce64[_0xb03c('0x2f')],_0x30ce64[_0xb03c('0x31')]);_0x217934['attributes']=_['intersection'](_0x30ce64[_0xb03c('0x2f')],qs[_0xb03c('0x33')](_0x485349['query'][_0xb03c('0x33')]));_0x217934[_0xb03c('0x34')]=_0x217934['attributes'][_0xb03c('0x35')]?_0x217934[_0xb03c('0x34')]:_0x30ce64[_0xb03c('0x2f')];if(!_0x485349['query'][_0xb03c('0x36')](_0xb03c('0x37'))){_0x217934[_0xb03c('0x1c')]=qs[_0xb03c('0x1c')](_0x485349[_0xb03c('0x31')][_0xb03c('0x1c')]);_0x217934[_0xb03c('0x1b')]=qs[_0xb03c('0x1b')](_0x485349['query'][_0xb03c('0x1b')]);}_0x217934[_0xb03c('0x38')]=qs[_0xb03c('0x39')](_0x485349[_0xb03c('0x31')][_0xb03c('0x39')]);_0x217934['where']=qs[_0xb03c('0x32')](_[_0xb03c('0x3a')](_0x485349[_0xb03c('0x31')],_0x30ce64['filters']));if(_0x485349['query'][_0xb03c('0x3b')]){_0x217934['where']=_[_0xb03c('0x3c')](_0x217934[_0xb03c('0x3d')],{'$or':_[_0xb03c('0x29')](_0x1ede9d,function(_0x6d4838){if(_0x6d4838[_0xb03c('0x2d')]!==_0xb03c('0x3e')){var _0xa557ce={};_0xa557ce[_0x6d4838[_0xb03c('0x26')]]={'$like':'%'+_0x485349[_0xb03c('0x31')][_0xb03c('0x3b')]+'%'};return _0xa557ce;}})});}_0x217934=_[_0xb03c('0x3c')]({},_0x217934,_0x485349['options']);var _0x18f111={'where':_0x217934[_0xb03c('0x3d')]};return db['FaxQueueReport'][_0xb03c('0x1a')](_0x18f111)[_0xb03c('0x22')](function(_0x58643f){_0x42c6d2[_0xb03c('0x1a')]=_0x58643f;if(_0x485349[_0xb03c('0x31')][_0xb03c('0x3f')]){_0x217934['include']=[{'all':!![]}];}return db[_0xb03c('0x2a')][_0xb03c('0x40')](_0x217934);})['then'](function(_0x2498c0){_0x42c6d2[_0xb03c('0x41')]=_0x2498c0;return _0x42c6d2;})[_0xb03c('0x22')](respondWithFilteredResult(_0x5a50b4,_0x217934))[_0xb03c('0x42')](handleError(_0x5a50b4,null));};exports['show']=function(_0x16efbe,_0x48d784){var _0x3f1641={'raw':!![],'where':{'id':_0x16efbe[_0xb03c('0x43')]['id']}},_0x41f2f9={};_0x41f2f9[_0xb03c('0x2f')]=_[_0xb03c('0x30')](db[_0xb03c('0x2a')]['rawAttributes']);_0x41f2f9['query']=_[_0xb03c('0x30')](_0x16efbe[_0xb03c('0x31')]);_0x41f2f9[_0xb03c('0x32')]=_[_0xb03c('0x44')](_0x41f2f9['model'],_0x41f2f9[_0xb03c('0x31')]);_0x3f1641[_0xb03c('0x34')]=_['intersection'](_0x41f2f9[_0xb03c('0x2f')],qs[_0xb03c('0x33')](_0x16efbe[_0xb03c('0x31')][_0xb03c('0x33')]));_0x3f1641[_0xb03c('0x34')]=_0x3f1641[_0xb03c('0x34')]['length']?_0x3f1641[_0xb03c('0x34')]:_0x41f2f9[_0xb03c('0x2f')];if(_0x16efbe[_0xb03c('0x31')][_0xb03c('0x3f')]){_0x3f1641[_0xb03c('0x45')]=[{'all':!![]}];}_0x3f1641=_[_0xb03c('0x3c')]({},_0x3f1641,_0x16efbe[_0xb03c('0x46')]);return db['FaxQueueReport'][_0xb03c('0x47')](_0x3f1641)[_0xb03c('0x22')](handleEntityNotFound(_0x48d784,null))[_0xb03c('0x22')](respondWithResult(_0x48d784,null))[_0xb03c('0x42')](handleError(_0x48d784,null));};exports[_0xb03c('0x48')]=function(_0x1c2fd2,_0x4ea99d){return db[_0xb03c('0x2a')][_0xb03c('0x48')](_0x1c2fd2[_0xb03c('0x49')],{})[_0xb03c('0x22')](respondWithResult(_0x4ea99d,0xc9))[_0xb03c('0x42')](handleError(_0x4ea99d,null));};exports[_0xb03c('0x21')]=function(_0x5ef4ca,_0x3555af){if(_0x5ef4ca[_0xb03c('0x49')]['id']){delete _0x5ef4ca[_0xb03c('0x49')]['id'];}return db[_0xb03c('0x2a')][_0xb03c('0x47')]({'where':{'id':_0x5ef4ca[_0xb03c('0x43')]['id']}})[_0xb03c('0x22')](handleEntityNotFound(_0x3555af,null))['then'](saveUpdates(_0x5ef4ca[_0xb03c('0x49')],null))['then'](respondWithResult(_0x3555af,null))['catch'](handleError(_0x3555af,null));};exports[_0xb03c('0x23')]=function(_0x9cef1f,_0x12a820){return db['FaxQueueReport'][_0xb03c('0x47')]({'where':{'id':_0x9cef1f[_0xb03c('0x43')]['id']}})['then'](handleEntityNotFound(_0x12a820,null))[_0xb03c('0x22')](removeEntity(_0x12a820,null))[_0xb03c('0x42')](handleError(_0x12a820,null));};exports[_0xb03c('0x4a')]=function(_0x45f1c4,_0x500b4f){return db[_0xb03c('0x2a')]['describe']()['then'](respondWithResult(_0x500b4f,null))['catch'](handleError(_0x500b4f,null));};
\ No newline at end of file
+var _0x04f2=['sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','status','error','stack','name','send','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','FaxQueueReport','includeAll','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','path'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x04f2,0xcc));var _0x204f=function(_0x5a654d,_0x1da2db){_0x5a654d=_0x5a654d-0x0;var _0x1c5f97=_0x04f2[_0x5a654d];return _0x1c5f97;};'use strict';var pdf=require(_0x204f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x204f('0x1'));var jsonpatch=require(_0x204f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x204f('0x3'));var Mustache=require(_0x204f('0x4'));var util=require('util');var path=require(_0x204f('0x5'));var sox=require(_0x204f('0x6'));var csv=require(_0x204f('0x7'));var ejs=require(_0x204f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x204f('0x9'));var crypto=require(_0x204f('0xa'));var jsforce=require(_0x204f('0xb'));var deskjs=require(_0x204f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x204f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x204f('0xe'));var as=require(_0x204f('0xf'));var hardwareService=require(_0x204f('0x10'));var logger=require(_0x204f('0x11'))('api');var utils=require(_0x204f('0x12'));var config=require(_0x204f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e201f,_0x6cf028){_0x6cf028=_0x6cf028||0xcc;return function(_0x162beb){if(_0x162beb){return _0x4e201f[_0x204f('0x14')](_0x6cf028);}return _0x4e201f['status'](_0x6cf028)[_0x204f('0x15')]();};}function respondWithResult(_0x422927,_0x41f1b9){_0x41f1b9=_0x41f1b9||0xc8;return function(_0x5290f7){if(_0x5290f7){return _0x422927['status'](_0x41f1b9)[_0x204f('0x16')](_0x5290f7);}};}function respondWithFilteredResult(_0x563016,_0x5d1408){return function(_0x34db4b){if(_0x34db4b){var _0x4d556d=_0x34db4b[_0x204f('0x17')],_0xb7b939=_0x5d1408[_0x204f('0x18')],_0xa5a692=_0x5d1408[_0x204f('0x18')]+_0x5d1408[_0x204f('0x19')],_0x28add4;if(_0xa5a692>=_0x4d556d){_0xa5a692=_0x4d556d;_0x28add4=0xc8;}else{_0x28add4=0xce;}_0x563016['status'](_0x28add4);return _0x563016[_0x204f('0x1a')](_0x204f('0x1b'),_0xb7b939+'-'+_0xa5a692+'/'+_0x4d556d)['json'](_0x34db4b);}return null;};}function patchUpdates(_0x183791){return function(_0x51395c){try{jsonpatch[_0x204f('0x1c')](_0x51395c,_0x183791,!![]);}catch(_0x3df379){return BPromise[_0x204f('0x1d')](_0x3df379);}return _0x51395c['save']();};}function saveUpdates(_0x17b68a,_0x121f73){return function(_0x352f55){if(_0x352f55){return _0x352f55[_0x204f('0x1e')](_0x17b68a)['then'](function(_0x28b1d3){return _0x28b1d3;});}return null;};}function removeEntity(_0x4d0c4e,_0x5a5eb6){return function(_0x1ca56a){if(_0x1ca56a){return _0x1ca56a[_0x204f('0x1f')]()[_0x204f('0x20')](function(){_0x4d0c4e[_0x204f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x598ce3,_0x29d226){return function(_0x39a9ea){if(!_0x39a9ea){_0x598ce3[_0x204f('0x14')](0x194);}return _0x39a9ea;};}function handleError(_0x4bc2af,_0x1c48d8){_0x1c48d8=_0x1c48d8||0x1f4;return function(_0x3623d4){logger[_0x204f('0x22')](_0x3623d4[_0x204f('0x23')]);if(_0x3623d4[_0x204f('0x24')]){delete _0x3623d4[_0x204f('0x24')];}_0x4bc2af['status'](_0x1c48d8)[_0x204f('0x25')](_0x3623d4);};}exports['index']=function(_0x59b98a,_0x18ba6c){var _0x5950d3={},_0x5b5e5b={},_0x4b2c47={'count':0x0,'rows':[]};var _0x19c281=_[_0x204f('0x26')](db['FaxQueueReport'][_0x204f('0x27')],function(_0x1701b4){return{'name':_0x1701b4[_0x204f('0x28')],'type':_0x1701b4[_0x204f('0x29')]['key']};});_0x5b5e5b[_0x204f('0x2a')]=_['map'](_0x19c281,'name');_0x5b5e5b['query']=_[_0x204f('0x2b')](_0x59b98a[_0x204f('0x2c')]);_0x5b5e5b[_0x204f('0x2d')]=_[_0x204f('0x2e')](_0x5b5e5b['model'],_0x5b5e5b[_0x204f('0x2c')]);_0x5950d3[_0x204f('0x2f')]=_[_0x204f('0x2e')](_0x5b5e5b['model'],qs[_0x204f('0x30')](_0x59b98a[_0x204f('0x2c')]['fields']));_0x5950d3[_0x204f('0x2f')]=_0x5950d3[_0x204f('0x2f')][_0x204f('0x31')]?_0x5950d3[_0x204f('0x2f')]:_0x5b5e5b[_0x204f('0x2a')];if(!_0x59b98a['query']['hasOwnProperty'](_0x204f('0x32'))){_0x5950d3[_0x204f('0x19')]=qs[_0x204f('0x19')](_0x59b98a[_0x204f('0x2c')][_0x204f('0x19')]);_0x5950d3['offset']=qs[_0x204f('0x18')](_0x59b98a['query']['offset']);}_0x5950d3[_0x204f('0x33')]=qs[_0x204f('0x34')](_0x59b98a[_0x204f('0x2c')][_0x204f('0x34')]);_0x5950d3['where']=qs[_0x204f('0x2d')](_[_0x204f('0x35')](_0x59b98a[_0x204f('0x2c')],_0x5b5e5b[_0x204f('0x2d')]),_0x19c281);if(_0x59b98a['query'][_0x204f('0x36')]){_0x5950d3[_0x204f('0x37')]=_['merge'](_0x5950d3['where'],{'$or':_[_0x204f('0x26')](_0x19c281,function(_0x5ef9c7){if(_0x5ef9c7['type']!==_0x204f('0x38')){var _0x23747a={};_0x23747a[_0x5ef9c7[_0x204f('0x24')]]={'$like':'%'+_0x59b98a[_0x204f('0x2c')][_0x204f('0x36')]+'%'};return _0x23747a;}})});}_0x5950d3=_[_0x204f('0x39')]({},_0x5950d3,_0x59b98a[_0x204f('0x3a')]);var _0x4bf544={'where':_0x5950d3[_0x204f('0x37')]};return db[_0x204f('0x3b')][_0x204f('0x17')](_0x4bf544)[_0x204f('0x20')](function(_0x2c82cb){_0x4b2c47['count']=_0x2c82cb;if(_0x59b98a['query'][_0x204f('0x3c')]){_0x5950d3['include']=[{'all':!![]}];}return db[_0x204f('0x3b')][_0x204f('0x3d')](_0x5950d3);})['then'](function(_0x12b830){_0x4b2c47[_0x204f('0x3e')]=_0x12b830;return _0x4b2c47;})[_0x204f('0x20')](respondWithFilteredResult(_0x18ba6c,_0x5950d3))[_0x204f('0x3f')](handleError(_0x18ba6c,null));};exports[_0x204f('0x40')]=function(_0x1da552,_0x5454c3){var _0x439ac2={'raw':!![],'where':{'id':_0x1da552[_0x204f('0x41')]['id']}},_0x5353ef={};_0x5353ef['model']=_[_0x204f('0x2b')](db[_0x204f('0x3b')][_0x204f('0x27')]);_0x5353ef[_0x204f('0x2c')]=_[_0x204f('0x2b')](_0x1da552['query']);_0x5353ef['filters']=_[_0x204f('0x2e')](_0x5353ef[_0x204f('0x2a')],_0x5353ef[_0x204f('0x2c')]);_0x439ac2[_0x204f('0x2f')]=_[_0x204f('0x2e')](_0x5353ef[_0x204f('0x2a')],qs['fields'](_0x1da552[_0x204f('0x2c')][_0x204f('0x30')]));_0x439ac2[_0x204f('0x2f')]=_0x439ac2[_0x204f('0x2f')][_0x204f('0x31')]?_0x439ac2['attributes']:_0x5353ef[_0x204f('0x2a')];if(_0x1da552[_0x204f('0x2c')][_0x204f('0x3c')]){_0x439ac2['include']=[{'all':!![]}];}_0x439ac2=_[_0x204f('0x39')]({},_0x439ac2,_0x1da552[_0x204f('0x3a')]);return db['FaxQueueReport'][_0x204f('0x42')](_0x439ac2)['then'](handleEntityNotFound(_0x5454c3,null))[_0x204f('0x20')](respondWithResult(_0x5454c3,null))['catch'](handleError(_0x5454c3,null));};exports[_0x204f('0x43')]=function(_0x4f4c83,_0x139c8f){return db[_0x204f('0x3b')][_0x204f('0x43')](_0x4f4c83[_0x204f('0x44')],{})[_0x204f('0x20')](respondWithResult(_0x139c8f,0xc9))['catch'](handleError(_0x139c8f,null));};exports['update']=function(_0x3e210b,_0x3f4082){if(_0x3e210b[_0x204f('0x44')]['id']){delete _0x3e210b[_0x204f('0x44')]['id'];}return db[_0x204f('0x3b')]['find']({'where':{'id':_0x3e210b[_0x204f('0x41')]['id']}})[_0x204f('0x20')](handleEntityNotFound(_0x3f4082,null))[_0x204f('0x20')](saveUpdates(_0x3e210b['body'],null))[_0x204f('0x20')](respondWithResult(_0x3f4082,null))['catch'](handleError(_0x3f4082,null));};exports['destroy']=function(_0x22d16f,_0x21b7d6){return db['FaxQueueReport'][_0x204f('0x42')]({'where':{'id':_0x22d16f[_0x204f('0x41')]['id']}})[_0x204f('0x20')](handleEntityNotFound(_0x21b7d6,null))[_0x204f('0x20')](removeEntity(_0x21b7d6,null))['catch'](handleError(_0x21b7d6,null));};exports[_0x204f('0x45')]=function(_0xc366c3,_0x336ec9){return db[_0x204f('0x3b')][_0x204f('0x45')]()[_0x204f('0x20')](respondWithResult(_0x336ec9,null))[_0x204f('0x3f')](handleError(_0x336ec9,null));};
\ No newline at end of file