Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / mailApplication / mailApplication.controller.js
index 0c450a0..75bbe7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55a5=['catch','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields','includeAll','merge','options'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x55a5,0xf7));var _0x555a=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x55a5[_0x1e4150];return _0x1ce3ee;};'use strict';var pdf=require(_0x555a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x555a('0x1'));var zipdir=require(_0x555a('0x2'));var jsonpatch=require(_0x555a('0x3'));var rp=require(_0x555a('0x4'));var moment=require(_0x555a('0x5'));var BPromise=require(_0x555a('0x6'));var Mustache=require(_0x555a('0x7'));var util=require(_0x555a('0x8'));var path=require(_0x555a('0x9'));var sox=require(_0x555a('0xa'));var csv=require(_0x555a('0xb'));var ejs=require(_0x555a('0xc'));var fs=require('fs');var _=require(_0x555a('0xd'));var squel=require(_0x555a('0xe'));var crypto=require(_0x555a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x555a('0x10'));var toCsv=require(_0x555a('0xb'));var querystring=require(_0x555a('0x11'));var Papa=require(_0x555a('0x12'));var Redis=require(_0x555a('0x13'));var authService=require(_0x555a('0x14'));var qs=require(_0x555a('0x15'));var as=require(_0x555a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x555a('0x17'))(_0x555a('0x18'));var utils=require(_0x555a('0x19'));var config=require(_0x555a('0x1a'));var db=require(_0x555a('0x1b'))['db'];function respondWithStatusCode(_0x53f452,_0x5ab086){_0x5ab086=_0x5ab086||0xcc;return function(_0x501eea){if(_0x501eea){return _0x53f452['sendStatus'](_0x5ab086);}return _0x53f452[_0x555a('0x1c')](_0x5ab086)[_0x555a('0x1d')]();};}function respondWithResult(_0xdf5d6f,_0x3a5da6){_0x3a5da6=_0x3a5da6||0xc8;return function(_0x1c5016){if(_0x1c5016){return _0xdf5d6f[_0x555a('0x1c')](_0x3a5da6)[_0x555a('0x1e')](_0x1c5016);}};}function respondWithFilteredResult(_0x29ad45,_0x5dee0e){return function(_0x4b925b){if(_0x4b925b){var _0x503e51=_0x4b925b['count'],_0x1532b4=_0x5dee0e[_0x555a('0x1f')],_0x411605=_0x5dee0e[_0x555a('0x1f')]+_0x5dee0e[_0x555a('0x20')],_0x4363ac;if(_0x411605>=_0x503e51){_0x411605=_0x503e51;_0x4363ac=0xc8;}else{_0x4363ac=0xce;}_0x29ad45['status'](_0x4363ac);return _0x29ad45[_0x555a('0x21')]('Content-Range',_0x1532b4+'-'+_0x411605+'/'+_0x503e51)[_0x555a('0x1e')](_0x4b925b);}return null;};}function patchUpdates(_0x330e85){return function(_0x23124d){try{jsonpatch[_0x555a('0x22')](_0x23124d,_0x330e85,!![]);}catch(_0x24893a){return BPromise[_0x555a('0x23')](_0x24893a);}return _0x23124d[_0x555a('0x24')]();};}function saveUpdates(_0x1a4a40,_0x576acd){return function(_0x441c55){if(_0x441c55){return _0x441c55[_0x555a('0x25')](_0x1a4a40)[_0x555a('0x26')](function(_0x55116b){return _0x55116b;});}return null;};}function removeEntity(_0x2a4ee1,_0x23026e){return function(_0x4d0ecf){if(_0x4d0ecf){return _0x4d0ecf[_0x555a('0x27')]()[_0x555a('0x26')](function(){_0x2a4ee1[_0x555a('0x1c')](0xcc)[_0x555a('0x1d')]();});}};}function handleEntityNotFound(_0x1e6328,_0x2f7a93){return function(_0x32a465){if(!_0x32a465){_0x1e6328[_0x555a('0x28')](0x194);}return _0x32a465;};}function handleError(_0x52f7ca,_0x2db80b){_0x2db80b=_0x2db80b||0x1f4;return function(_0x298450){logger[_0x555a('0x29')](_0x298450[_0x555a('0x2a')]);if(_0x298450[_0x555a('0x2b')]){delete _0x298450[_0x555a('0x2b')];}_0x52f7ca['status'](_0x2db80b)['send'](_0x298450);};}exports[_0x555a('0x2c')]=function(_0x2dab06,_0x40998d){var _0xf90368={'raw':!![],'where':{'id':_0x2dab06[_0x555a('0x2d')]['id']}},_0x460519={};_0x460519['model']=_['keys'](db[_0x555a('0x2e')][_0x555a('0x2f')]);_0x460519[_0x555a('0x30')]=_[_0x555a('0x31')](_0x2dab06[_0x555a('0x30')]);_0x460519[_0x555a('0x32')]=_[_0x555a('0x33')](_0x460519[_0x555a('0x34')],_0x460519[_0x555a('0x30')]);_0xf90368[_0x555a('0x35')]=_[_0x555a('0x33')](_0x460519['model'],qs['fields'](_0x2dab06['query'][_0x555a('0x36')]));_0xf90368[_0x555a('0x35')]=_0xf90368['attributes']['length']?_0xf90368[_0x555a('0x35')]:_0x460519[_0x555a('0x34')];if(_0x2dab06[_0x555a('0x30')][_0x555a('0x37')]){_0xf90368['include']=[{'all':!![]}];}_0xf90368=_[_0x555a('0x38')]({},_0xf90368,_0x2dab06[_0x555a('0x39')]);return db[_0x555a('0x2e')]['find'](_0xf90368)[_0x555a('0x26')](handleEntityNotFound(_0x40998d,null))[_0x555a('0x26')](respondWithResult(_0x40998d,null))[_0x555a('0x3a')](handleError(_0x40998d,null));};exports[_0x555a('0x25')]=function(_0x36e9d7,_0x1f2f8d){if(_0x36e9d7[_0x555a('0x3b')]['id']){delete _0x36e9d7[_0x555a('0x3b')]['id'];}return db[_0x555a('0x2e')]['find']({'where':{'id':_0x36e9d7[_0x555a('0x2d')]['id']}})[_0x555a('0x26')](handleEntityNotFound(_0x1f2f8d,null))['then'](saveUpdates(_0x36e9d7['body'],null))['then'](respondWithResult(_0x1f2f8d,null))[_0x555a('0x3a')](handleError(_0x1f2f8d,null));};exports[_0x555a('0x27')]=function(_0x2a49cb,_0x1f868c){return db[_0x555a('0x2e')][_0x555a('0x3c')]({'where':{'id':_0x2a49cb['params']['id']}})['then'](handleEntityNotFound(_0x1f868c,null))[_0x555a('0x26')](removeEntity(_0x1f868c,null))[_0x555a('0x3a')](handleError(_0x1f868c,null));};
\ No newline at end of file
+var _0x815c=['then','sendStatus','name','send','show','params','query','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','MailApplication','find','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','end','status','json','offset','set','Content-Range','reject','save','update'];(function(_0x47b125,_0x13a098){var _0x966a94=function(_0x4c25e7){while(--_0x4c25e7){_0x47b125['push'](_0x47b125['shift']());}};_0x966a94(++_0x13a098);}(_0x815c,0x19d));var _0xc815=function(_0x19e013,_0x5c74e0){_0x19e013=_0x19e013-0x0;var _0x58c128=_0x815c[_0x19e013];return _0x58c128;};'use strict';var pdf=require(_0xc815('0x0'));var emlformat=require(_0xc815('0x1'));var rimraf=require(_0xc815('0x2'));var zipdir=require(_0xc815('0x3'));var jsonpatch=require(_0xc815('0x4'));var rp=require(_0xc815('0x5'));var moment=require(_0xc815('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc815('0x7'));var util=require(_0xc815('0x8'));var path=require(_0xc815('0x9'));var sox=require(_0xc815('0xa'));var csv=require('to-csv');var ejs=require(_0xc815('0xb'));var fs=require('fs');var _=require(_0xc815('0xc'));var squel=require('squel');var crypto=require(_0xc815('0xd'));var jsforce=require(_0xc815('0xe'));var deskjs=require(_0xc815('0xf'));var toCsv=require(_0xc815('0x10'));var querystring=require(_0xc815('0x11'));var Papa=require(_0xc815('0x12'));var Redis=require(_0xc815('0x13'));var authService=require(_0xc815('0x14'));var qs=require(_0xc815('0x15'));var as=require(_0xc815('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc815('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xc815('0x18'));var licenseUtil=require(_0xc815('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508bd1,_0x4227d7){_0x4227d7=_0x4227d7||0xcc;return function(_0x3ccf1a){if(_0x3ccf1a){return _0x508bd1['sendStatus'](_0x4227d7);}return _0x508bd1['status'](_0x4227d7)[_0xc815('0x1a')]();};}function respondWithResult(_0x40ffc3,_0x1ef9cf){_0x1ef9cf=_0x1ef9cf||0xc8;return function(_0x72bb2a){if(_0x72bb2a){return _0x40ffc3[_0xc815('0x1b')](_0x1ef9cf)[_0xc815('0x1c')](_0x72bb2a);}};}function respondWithFilteredResult(_0x35bdbd,_0xb3e819){return function(_0x30aa98){if(_0x30aa98){var _0x1d19a9=_0x30aa98['count'],_0x57f9a2=_0xb3e819[_0xc815('0x1d')],_0x24187f=_0xb3e819[_0xc815('0x1d')]+_0xb3e819['limit'],_0x3e6145;if(_0x24187f>=_0x1d19a9){_0x24187f=_0x1d19a9;_0x3e6145=0xc8;}else{_0x3e6145=0xce;}_0x35bdbd[_0xc815('0x1b')](_0x3e6145);return _0x35bdbd[_0xc815('0x1e')](_0xc815('0x1f'),_0x57f9a2+'-'+_0x24187f+'/'+_0x1d19a9)[_0xc815('0x1c')](_0x30aa98);}return null;};}function patchUpdates(_0x13b60d){return function(_0x201042){try{jsonpatch['apply'](_0x201042,_0x13b60d,!![]);}catch(_0x2c482d){return BPromise[_0xc815('0x20')](_0x2c482d);}return _0x201042[_0xc815('0x21')]();};}function saveUpdates(_0x3933f2,_0x557a6d){return function(_0x26fa30){if(_0x26fa30){return _0x26fa30[_0xc815('0x22')](_0x3933f2)[_0xc815('0x23')](function(_0x1cbf69){return _0x1cbf69;});}return null;};}function removeEntity(_0x45a411,_0x126502){return function(_0x50ccf3){if(_0x50ccf3){return _0x50ccf3['destroy']()['then'](function(){_0x45a411['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf07be0,_0x4ef43c){return function(_0x401ef3){if(!_0x401ef3){_0xf07be0[_0xc815('0x24')](0x194);}return _0x401ef3;};}function handleError(_0x2bb2c0,_0x39e4d5){_0x39e4d5=_0x39e4d5||0x1f4;return function(_0x50b224){logger['error'](_0x50b224['stack']);if(_0x50b224[_0xc815('0x25')]){delete _0x50b224['name'];}_0x2bb2c0[_0xc815('0x1b')](_0x39e4d5)[_0xc815('0x26')](_0x50b224);};}exports[_0xc815('0x27')]=function(_0x2524b2,_0x63ce44){var _0x36549e={'raw':!![],'where':{'id':_0x2524b2[_0xc815('0x28')]['id']}},_0x38bdbd={};_0x38bdbd['model']=_['keys'](db['MailApplication']['rawAttributes']);_0x38bdbd[_0xc815('0x29')]=_['keys'](_0x2524b2[_0xc815('0x29')]);_0x38bdbd[_0xc815('0x2a')]=_[_0xc815('0x2b')](_0x38bdbd['model'],_0x38bdbd[_0xc815('0x29')]);_0x36549e[_0xc815('0x2c')]=_['intersection'](_0x38bdbd[_0xc815('0x2d')],qs[_0xc815('0x2e')](_0x2524b2[_0xc815('0x29')][_0xc815('0x2e')]));_0x36549e[_0xc815('0x2c')]=_0x36549e['attributes'][_0xc815('0x2f')]?_0x36549e['attributes']:_0x38bdbd[_0xc815('0x2d')];if(_0x2524b2['query'][_0xc815('0x30')]){_0x36549e[_0xc815('0x31')]=[{'all':!![]}];}_0x36549e=_[_0xc815('0x32')]({},_0x36549e,_0x2524b2[_0xc815('0x33')]);return db[_0xc815('0x34')][_0xc815('0x35')](_0x36549e)['then'](handleEntityNotFound(_0x63ce44,null))['then'](respondWithResult(_0x63ce44,null))['catch'](handleError(_0x63ce44,null));};exports[_0xc815('0x22')]=function(_0x31baa7,_0x53a684){if(_0x31baa7[_0xc815('0x36')]['id']){delete _0x31baa7[_0xc815('0x36')]['id'];}return db[_0xc815('0x34')]['find']({'where':{'id':_0x31baa7['params']['id']}})[_0xc815('0x23')](handleEntityNotFound(_0x53a684,null))[_0xc815('0x23')](saveUpdates(_0x31baa7[_0xc815('0x36')],null))[_0xc815('0x23')](respondWithResult(_0x53a684,null))[_0xc815('0x37')](handleError(_0x53a684,null));};exports['destroy']=function(_0x1727ef,_0x2257f2){return db['MailApplication'][_0xc815('0x35')]({'where':{'id':_0x1727ef['params']['id']}})[_0xc815('0x23')](handleEntityNotFound(_0x2257f2,null))[_0xc815('0x23')](removeEntity(_0x2257f2,null))[_0xc815('0x37')](handleError(_0x2257f2,null));};
\ No newline at end of file