Built motion from commit (unavailable).|2.3.4
[motion2.git] / server / api / squareRecording / squareRecording.controller.js
index e95dad3..e8464ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f9b=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','type','VIRTUAL','field','merge','includeAll','include','findAll','then','catch','show','params','options','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','value','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','stack','name','index','SquareRecording','rawAttributes'];(function(_0x581c74,_0x98e9e2){var _0x2ed19e=function(_0x5a67cb){while(--_0x5a67cb){_0x581c74['push'](_0x581c74['shift']());}};_0x2ed19e(++_0x98e9e2);}(_0x9f9b,0xdb));var _0xb9f9=function(_0x2fb37d,_0x5ac84d){_0x2fb37d=_0x2fb37d-0x0;var _0x287bd9=_0x9f9b[_0x2fb37d];return _0x287bd9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9f9('0x0'));var rimraf=require(_0xb9f9('0x1'));var zipdir=require(_0xb9f9('0x2'));var jsonpatch=require(_0xb9f9('0x3'));var rp=require(_0xb9f9('0x4'));var moment=require('moment');var BPromise=require(_0xb9f9('0x5'));var Mustache=require(_0xb9f9('0x6'));var util=require(_0xb9f9('0x7'));var path=require(_0xb9f9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb9f9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb9f9('0xa'));var crypto=require(_0xb9f9('0xb'));var jsforce=require(_0xb9f9('0xc'));var deskjs=require(_0xb9f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb9f9('0xe'));var Papa=require(_0xb9f9('0xf'));var authService=require(_0xb9f9('0x10'));var hardwareService=require(_0xb9f9('0x11'));var Redis=require(_0xb9f9('0x12'));var qs=require(_0xb9f9('0x13'));var logger=require(_0xb9f9('0x14'))(_0xb9f9('0x15'));var utils=require(_0xb9f9('0x16'));var config=require(_0xb9f9('0x17'));var db=require(_0xb9f9('0x18'))['db'];function respondWithStatusCode(_0x382500,_0x69b6a6){_0x69b6a6=_0x69b6a6||0xcc;return function(_0x31cf84){if(_0x31cf84){return _0x382500[_0xb9f9('0x19')](_0x69b6a6);}return _0x382500[_0xb9f9('0x1a')](_0x69b6a6)[_0xb9f9('0x1b')]();};}function respondWithResult(_0x53a064,_0x37b57c){_0x37b57c=_0x37b57c||0xc8;return function(_0x4c9159){if(_0x4c9159){return _0x53a064[_0xb9f9('0x1a')](_0x37b57c)[_0xb9f9('0x1c')](_0x4c9159);}};}function respondWithFilteredResult(_0x285fbb,_0x2d2982){return function(_0x53842d){if(_0x53842d){var _0x503a3e=_0x53842d[_0xb9f9('0x1d')],_0x1ab48f=_0x2d2982[_0xb9f9('0x1e')],_0x1a2a33=_0x2d2982['offset']+_0x2d2982[_0xb9f9('0x1f')],_0x184be7;if(_0x1a2a33>=_0x503a3e){_0x1a2a33=_0x503a3e;_0x184be7=0xc8;}else{_0x184be7=0xce;}_0x285fbb['status'](_0x184be7);return _0x285fbb[_0xb9f9('0x20')](_0xb9f9('0x21'),_0x1ab48f+'-'+_0x1a2a33+'/'+_0x503a3e)[_0xb9f9('0x1c')](_0x53842d);}return null;};}function patchUpdates(_0x13d530){return function(_0x5e2765){try{jsonpatch[_0xb9f9('0x22')](_0x5e2765,_0x13d530,!![]);}catch(_0x404b6c){return BPromise[_0xb9f9('0x23')](_0x404b6c);}return _0x5e2765[_0xb9f9('0x24')]();};}function saveUpdates(_0xdaf88f,_0x167959){return function(_0x4482f9){if(_0x4482f9){return _0x4482f9['update'](_0xdaf88f)['then'](function(_0x44b25c){return _0x44b25c;});}return null;};}function removeEntity(_0x31119b,_0x1359a1){return function(_0x58acf1){if(_0x58acf1){return _0x58acf1['destroy']()['then'](function(){_0x31119b[_0xb9f9('0x1a')](0xcc)[_0xb9f9('0x1b')]();});}};}function handleEntityNotFound(_0xf29d14,_0x53c239){return function(_0x511a5e){if(!_0x511a5e){_0xf29d14[_0xb9f9('0x19')](0x194);}return _0x511a5e;};}function handleError(_0x475a11,_0x4dd050){_0x4dd050=_0x4dd050||0x1f4;return function(_0x4b464a){logger['error'](_0x4b464a[_0xb9f9('0x25')]);if(_0x4b464a[_0xb9f9('0x26')]){delete _0x4b464a['name'];}_0x475a11[_0xb9f9('0x1a')](_0x4dd050)['send'](_0x4b464a);};}exports[_0xb9f9('0x27')]=function(_0x35edf,_0x2bb021){var _0x3ea06d={},_0x24ff1c={},_0x1ee625={'count':0x0,'rows':[]};var _0x3cfd16=db[_0xb9f9('0x28')][_0xb9f9('0x29')];_0x24ff1c[_0xb9f9('0x2a')]=_[_0xb9f9('0x2b')](_0x3cfd16);_0x24ff1c[_0xb9f9('0x2c')]=_[_0xb9f9('0x2b')](_0x35edf[_0xb9f9('0x2c')]);_0x24ff1c[_0xb9f9('0x2d')]=_[_0xb9f9('0x2e')](_0x24ff1c['model'],_0x24ff1c[_0xb9f9('0x2c')]);_0x3ea06d[_0xb9f9('0x2f')]=_[_0xb9f9('0x2e')](_0x24ff1c[_0xb9f9('0x2a')],qs[_0xb9f9('0x30')](_0x35edf['query']['fields']));_0x3ea06d[_0xb9f9('0x2f')]=_0x3ea06d[_0xb9f9('0x2f')][_0xb9f9('0x31')]?_0x3ea06d['attributes']:_0x24ff1c['model'];if(!_0x35edf['query'][_0xb9f9('0x32')](_0xb9f9('0x33'))){_0x3ea06d[_0xb9f9('0x1f')]=qs[_0xb9f9('0x1f')](_0x35edf[_0xb9f9('0x2c')][_0xb9f9('0x1f')]);_0x3ea06d['offset']=qs[_0xb9f9('0x1e')](_0x35edf[_0xb9f9('0x2c')]['offset']);}_0x3ea06d[_0xb9f9('0x34')]=qs['sort'](_0x35edf[_0xb9f9('0x2c')]['sort']);_0x3ea06d[_0xb9f9('0x35')]=qs[_0xb9f9('0x2d')](_[_0xb9f9('0x36')](_0x35edf['query'],_0x24ff1c[_0xb9f9('0x2d')]));if(_0x35edf[_0xb9f9('0x2c')][_0xb9f9('0x37')]){_0x3ea06d[_0xb9f9('0x35')]=_['merge'](_0x3ea06d[_0xb9f9('0x35')],{'$or':_[_0xb9f9('0x38')](_0x3cfd16,function(_0x13c8e7){if(_0x13c8e7[_0xb9f9('0x39')]['key']!==_0xb9f9('0x3a')){var _0xa9cfa2={};_0xa9cfa2[_0x13c8e7[_0xb9f9('0x3b')]]={'$like':'%'+_0x35edf[_0xb9f9('0x2c')][_0xb9f9('0x37')]+'%'};return _0xa9cfa2;}})});}_0x3ea06d=_[_0xb9f9('0x3c')]({},_0x3ea06d,_0x35edf['options']);var _0x5d6f3d={'where':_0x3ea06d[_0xb9f9('0x35')]};return db[_0xb9f9('0x28')][_0xb9f9('0x1d')](_0x5d6f3d)['then'](function(_0x8d4b2f){_0x1ee625['count']=_0x8d4b2f;if(_0x35edf[_0xb9f9('0x2c')][_0xb9f9('0x3d')]){_0x3ea06d[_0xb9f9('0x3e')]=[{'all':!![]}];}return db[_0xb9f9('0x28')][_0xb9f9('0x3f')](_0x3ea06d);})[_0xb9f9('0x40')](function(_0x2e1150){_0x1ee625['rows']=_0x2e1150;return _0x1ee625;})[_0xb9f9('0x40')](respondWithFilteredResult(_0x2bb021,_0x3ea06d))[_0xb9f9('0x41')](handleError(_0x2bb021,null));};exports[_0xb9f9('0x42')]=function(_0x428c26,_0x3a5c07){var _0x5517f3={'raw':!![],'where':{'id':_0x428c26[_0xb9f9('0x43')]['id']}},_0x499f1a={};_0x499f1a[_0xb9f9('0x2a')]=_['keys'](db[_0xb9f9('0x28')][_0xb9f9('0x29')]);_0x499f1a[_0xb9f9('0x2c')]=_[_0xb9f9('0x2b')](_0x428c26[_0xb9f9('0x2c')]);_0x499f1a[_0xb9f9('0x2d')]=_[_0xb9f9('0x2e')](_0x499f1a[_0xb9f9('0x2a')],_0x499f1a[_0xb9f9('0x2c')]);_0x5517f3[_0xb9f9('0x2f')]=_[_0xb9f9('0x2e')](_0x499f1a[_0xb9f9('0x2a')],qs[_0xb9f9('0x30')](_0x428c26[_0xb9f9('0x2c')][_0xb9f9('0x30')]));_0x5517f3['attributes']=_0x5517f3[_0xb9f9('0x2f')][_0xb9f9('0x31')]?_0x5517f3[_0xb9f9('0x2f')]:_0x499f1a['model'];if(_0x428c26['query'][_0xb9f9('0x3d')]){_0x5517f3[_0xb9f9('0x3e')]=[{'all':!![]}];}_0x5517f3=_['merge']({},_0x5517f3,_0x428c26[_0xb9f9('0x44')]);return db['SquareRecording']['find'](_0x5517f3)[_0xb9f9('0x40')](handleEntityNotFound(_0x3a5c07,null))['then'](respondWithResult(_0x3a5c07,null))[_0xb9f9('0x41')](handleError(_0x3a5c07,null));};exports['create']=function(_0x577ec1,_0x4d163d){return db[_0xb9f9('0x28')][_0xb9f9('0x45')](_0x577ec1['body'],{})[_0xb9f9('0x40')](respondWithResult(_0x4d163d,0xc9))[_0xb9f9('0x41')](handleError(_0x4d163d,null));};exports['update']=function(_0x27efd4,_0x190caf){if(_0x27efd4[_0xb9f9('0x46')]['id']){delete _0x27efd4[_0xb9f9('0x46')]['id'];}return db[_0xb9f9('0x28')][_0xb9f9('0x47')]({'where':{'id':_0x27efd4[_0xb9f9('0x43')]['id']}})[_0xb9f9('0x40')](handleEntityNotFound(_0x190caf,null))[_0xb9f9('0x40')](saveUpdates(_0x27efd4[_0xb9f9('0x46')],null))[_0xb9f9('0x40')](respondWithResult(_0x190caf,null))[_0xb9f9('0x41')](handleError(_0x190caf,null));};exports['destroy']=function(_0x1fbc4e,_0x45ffe8){return db[_0xb9f9('0x28')][_0xb9f9('0x47')]({'where':{'id':_0x1fbc4e[_0xb9f9('0x43')]['id']}})[_0xb9f9('0x40')](handleEntityNotFound(_0x45ffe8,null))['then'](removeEntity(_0x45ffe8,null))[_0xb9f9('0x41')](handleError(_0x45ffe8,null));};exports[_0xb9f9('0x48')]=function(_0x1120d4,_0x57d083,_0x5439a1){var _0x251966=require(_0xb9f9('0x49'));var _0x5a3eaa=![];var _0x13c486={};if(_0x1120d4[_0xb9f9('0x2c')]['type']&&_0x1120d4[_0xb9f9('0x2c')][_0xb9f9('0x39')]===_0xb9f9('0x4a')){_0x13c486['uniqueid']=_0x1120d4[_0xb9f9('0x43')]['id'];}else{_0x13c486['id']=_0x1120d4[_0xb9f9('0x43')]['id'];}return db[_0xb9f9('0x28')][_0xb9f9('0x47')]({'where':_0x13c486,'attributes':['id',_0xb9f9('0x4b'),_0xb9f9('0x4c')],'raw':!![]})[_0xb9f9('0x40')](handleEntityNotFound(_0x57d083,null))[_0xb9f9('0x40')](function(_0x1f4a43){if(_0x1f4a43){var _0x3450db=util[_0xb9f9('0x4d')]('%s.cypher',_0x1f4a43[_0xb9f9('0x4e')]);if(fs[_0xb9f9('0x4f')](_0x3450db)){_0x5a3eaa=!![];return _0x251966[_0xb9f9('0x50')](_0x3450db,_0x1f4a43[_0xb9f9('0x4b')],config[_0xb9f9('0x51')][_0xb9f9('0x52')])['then'](function(){return _0x1f4a43;});}return _0x1f4a43;}})[_0xb9f9('0x40')](function(_0x4a89ad){if(_0x4a89ad){if(!fs[_0xb9f9('0x4f')](_0x4a89ad[_0xb9f9('0x4b')])){throw new db['Sequelize'][(_0xb9f9('0x53'))](_0xb9f9('0x54'));}if(_0x4a89ad['filename']){return _0x57d083[_0xb9f9('0x48')](_0x4a89ad['savePath'],_0x4a89ad['filename']+path[_0xb9f9('0x55')](_0x4a89ad[_0xb9f9('0x4b')]),function(){if(_0x5a3eaa){fs[_0xb9f9('0x56')](_0x4a89ad[_0xb9f9('0x4b')]);}});}else{return _0x57d083[_0xb9f9('0x48')](_0x4a89ad[_0xb9f9('0x4b')],function(_0x3cbe12){if(_0x5a3eaa){fs[_0xb9f9('0x56')](_0x4a89ad['savePath']);}});}}})['catch'](handleError(_0x57d083,null));};
\ No newline at end of file
+var _0x1cc9=['../../config/environment','../../mysqldb','end','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','SquareRecording','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','show','params','find','create','body','catch','download','uniqueid','savePath','filename','format','%s.cypher','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','papaparse','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x1cc9,0x1f1));var _0x91cc=function(_0x2313e8,_0x332e97){_0x2313e8=_0x2313e8-0x0;var _0x482a35=_0x1cc9[_0x2313e8];return _0x482a35;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x91cc('0x0'));var rimraf=require(_0x91cc('0x1'));var zipdir=require(_0x91cc('0x2'));var jsonpatch=require(_0x91cc('0x3'));var rp=require(_0x91cc('0x4'));var moment=require(_0x91cc('0x5'));var BPromise=require(_0x91cc('0x6'));var Mustache=require(_0x91cc('0x7'));var util=require(_0x91cc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x91cc('0x9'));var ejs=require(_0x91cc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x91cc('0xb'));var crypto=require(_0x91cc('0xc'));var jsforce=require(_0x91cc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x91cc('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x91cc('0xf'));var Redis=require('ioredis');var qs=require(_0x91cc('0x10'));var logger=require('../../config/logger')(_0x91cc('0x11'));var utils=require(_0x91cc('0x12'));var config=require(_0x91cc('0x13'));var db=require(_0x91cc('0x14'))['db'];function respondWithStatusCode(_0x17ebf7,_0x5c3b8a){_0x5c3b8a=_0x5c3b8a||0xcc;return function(_0x1756c2){if(_0x1756c2){return _0x17ebf7['sendStatus'](_0x5c3b8a);}return _0x17ebf7['status'](_0x5c3b8a)[_0x91cc('0x15')]();};}function respondWithResult(_0x451241,_0x5319a0){_0x5319a0=_0x5319a0||0xc8;return function(_0x1eddc0){if(_0x1eddc0){return _0x451241[_0x91cc('0x16')](_0x5319a0)[_0x91cc('0x17')](_0x1eddc0);}};}function respondWithFilteredResult(_0x583e22,_0x2ba656){return function(_0x529982){if(_0x529982){var _0x46ea3e=_0x529982[_0x91cc('0x18')],_0x1e23c0=_0x2ba656['offset'],_0x5becf9=_0x2ba656['offset']+_0x2ba656[_0x91cc('0x19')],_0x1b24a7;if(_0x5becf9>=_0x46ea3e){_0x5becf9=_0x46ea3e;_0x1b24a7=0xc8;}else{_0x1b24a7=0xce;}_0x583e22[_0x91cc('0x16')](_0x1b24a7);return _0x583e22[_0x91cc('0x1a')](_0x91cc('0x1b'),_0x1e23c0+'-'+_0x5becf9+'/'+_0x46ea3e)[_0x91cc('0x17')](_0x529982);}return null;};}function patchUpdates(_0x5c1091){return function(_0x2e8dec){try{jsonpatch[_0x91cc('0x1c')](_0x2e8dec,_0x5c1091,!![]);}catch(_0x55cb31){return BPromise[_0x91cc('0x1d')](_0x55cb31);}return _0x2e8dec[_0x91cc('0x1e')]();};}function saveUpdates(_0xf8e911,_0xcce020){return function(_0x3edb0a){if(_0x3edb0a){return _0x3edb0a[_0x91cc('0x1f')](_0xf8e911)[_0x91cc('0x20')](function(_0x39d5c4){return _0x39d5c4;});}return null;};}function removeEntity(_0x55b8c9,_0x4fa38c){return function(_0xc6ad78){if(_0xc6ad78){return _0xc6ad78[_0x91cc('0x21')]()[_0x91cc('0x20')](function(){_0x55b8c9[_0x91cc('0x16')](0xcc)[_0x91cc('0x15')]();});}};}function handleEntityNotFound(_0xd9f311,_0x1a48ca){return function(_0x36461f){if(!_0x36461f){_0xd9f311['sendStatus'](0x194);}return _0x36461f;};}function handleError(_0x2a5538,_0xd122e7){_0xd122e7=_0xd122e7||0x1f4;return function(_0x4c17f0){logger[_0x91cc('0x22')](_0x4c17f0['stack']);if(_0x4c17f0['name']){delete _0x4c17f0['name'];}_0x2a5538[_0x91cc('0x16')](_0xd122e7)[_0x91cc('0x23')](_0x4c17f0);};}exports[_0x91cc('0x24')]=function(_0x356c4e,_0x35ebed){var _0x4e5852={},_0x227253={},_0x57993e={'count':0x0,'rows':[]};var _0x29a985=db[_0x91cc('0x25')][_0x91cc('0x26')];_0x227253[_0x91cc('0x27')]=_[_0x91cc('0x28')](_0x29a985);_0x227253['query']=_[_0x91cc('0x28')](_0x356c4e[_0x91cc('0x29')]);_0x227253[_0x91cc('0x2a')]=_[_0x91cc('0x2b')](_0x227253[_0x91cc('0x27')],_0x227253[_0x91cc('0x29')]);_0x4e5852[_0x91cc('0x2c')]=_[_0x91cc('0x2b')](_0x227253[_0x91cc('0x27')],qs[_0x91cc('0x2d')](_0x356c4e[_0x91cc('0x29')][_0x91cc('0x2d')]));_0x4e5852['attributes']=_0x4e5852[_0x91cc('0x2c')][_0x91cc('0x2e')]?_0x4e5852[_0x91cc('0x2c')]:_0x227253[_0x91cc('0x27')];if(!_0x356c4e[_0x91cc('0x29')][_0x91cc('0x2f')](_0x91cc('0x30'))){_0x4e5852[_0x91cc('0x19')]=qs[_0x91cc('0x19')](_0x356c4e[_0x91cc('0x29')]['limit']);_0x4e5852[_0x91cc('0x31')]=qs[_0x91cc('0x31')](_0x356c4e[_0x91cc('0x29')][_0x91cc('0x31')]);}_0x4e5852['order']=qs['sort'](_0x356c4e[_0x91cc('0x29')][_0x91cc('0x32')]);_0x4e5852['where']=qs['filters'](_[_0x91cc('0x33')](_0x356c4e[_0x91cc('0x29')],_0x227253[_0x91cc('0x2a')]));if(_0x356c4e[_0x91cc('0x29')][_0x91cc('0x34')]){_0x4e5852[_0x91cc('0x35')]=_['merge'](_0x4e5852[_0x91cc('0x35')],{'$or':_[_0x91cc('0x36')](_0x29a985,function(_0x2ef6cd){if(_0x2ef6cd[_0x91cc('0x37')][_0x91cc('0x38')]!==_0x91cc('0x39')){var _0x2559ea={};_0x2559ea[_0x2ef6cd[_0x91cc('0x3a')]]={'$like':'%'+_0x356c4e['query'][_0x91cc('0x34')]+'%'};return _0x2559ea;}})});}_0x4e5852=_[_0x91cc('0x3b')]({},_0x4e5852,_0x356c4e[_0x91cc('0x3c')]);var _0x32d596={'where':_0x4e5852[_0x91cc('0x35')]};return db['SquareRecording'][_0x91cc('0x18')](_0x32d596)[_0x91cc('0x20')](function(_0x28da25){_0x57993e[_0x91cc('0x18')]=_0x28da25;if(_0x356c4e['query'][_0x91cc('0x3d')]){_0x4e5852[_0x91cc('0x3e')]=[{'all':!![]}];}return db[_0x91cc('0x25')][_0x91cc('0x3f')](_0x4e5852);})[_0x91cc('0x20')](function(_0x4d105e){_0x57993e['rows']=_0x4d105e;return _0x57993e;})[_0x91cc('0x20')](respondWithFilteredResult(_0x35ebed,_0x4e5852))['catch'](handleError(_0x35ebed,null));};exports[_0x91cc('0x40')]=function(_0x535030,_0x230101){var _0x315a94={'raw':!![],'where':{'id':_0x535030[_0x91cc('0x41')]['id']}},_0x5d0598={};_0x5d0598['model']=_[_0x91cc('0x28')](db[_0x91cc('0x25')][_0x91cc('0x26')]);_0x5d0598[_0x91cc('0x29')]=_[_0x91cc('0x28')](_0x535030[_0x91cc('0x29')]);_0x5d0598[_0x91cc('0x2a')]=_['intersection'](_0x5d0598[_0x91cc('0x27')],_0x5d0598[_0x91cc('0x29')]);_0x315a94['attributes']=_['intersection'](_0x5d0598[_0x91cc('0x27')],qs['fields'](_0x535030[_0x91cc('0x29')][_0x91cc('0x2d')]));_0x315a94[_0x91cc('0x2c')]=_0x315a94['attributes'][_0x91cc('0x2e')]?_0x315a94[_0x91cc('0x2c')]:_0x5d0598['model'];if(_0x535030[_0x91cc('0x29')][_0x91cc('0x3d')]){_0x315a94[_0x91cc('0x3e')]=[{'all':!![]}];}_0x315a94=_[_0x91cc('0x3b')]({},_0x315a94,_0x535030[_0x91cc('0x3c')]);return db[_0x91cc('0x25')][_0x91cc('0x42')](_0x315a94)[_0x91cc('0x20')](handleEntityNotFound(_0x230101,null))[_0x91cc('0x20')](respondWithResult(_0x230101,null))['catch'](handleError(_0x230101,null));};exports[_0x91cc('0x43')]=function(_0x25324e,_0x2293b6){return db[_0x91cc('0x25')]['create'](_0x25324e[_0x91cc('0x44')],{})['then'](respondWithResult(_0x2293b6,0xc9))[_0x91cc('0x45')](handleError(_0x2293b6,null));};exports[_0x91cc('0x1f')]=function(_0x32a9f,_0x5c5474){if(_0x32a9f[_0x91cc('0x44')]['id']){delete _0x32a9f[_0x91cc('0x44')]['id'];}return db[_0x91cc('0x25')][_0x91cc('0x42')]({'where':{'id':_0x32a9f[_0x91cc('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c5474,null))[_0x91cc('0x20')](saveUpdates(_0x32a9f[_0x91cc('0x44')],null))['then'](respondWithResult(_0x5c5474,null))[_0x91cc('0x45')](handleError(_0x5c5474,null));};exports['destroy']=function(_0x302fed,_0x3f5565){return db[_0x91cc('0x25')][_0x91cc('0x42')]({'where':{'id':_0x302fed['params']['id']}})[_0x91cc('0x20')](handleEntityNotFound(_0x3f5565,null))['then'](removeEntity(_0x3f5565,null))['catch'](handleError(_0x3f5565,null));};exports[_0x91cc('0x46')]=function(_0x58d2eb,_0x451d9a,_0x27bf03){var _0x47b4c9=require('../../components/encryptor');var _0x29ece5=![];var _0x2912a6={};if(_0x58d2eb[_0x91cc('0x29')][_0x91cc('0x37')]&&_0x58d2eb[_0x91cc('0x29')][_0x91cc('0x37')]===_0x91cc('0x47')){_0x2912a6[_0x91cc('0x47')]=_0x58d2eb['params']['id'];}else{_0x2912a6['id']=_0x58d2eb[_0x91cc('0x41')]['id'];}return db[_0x91cc('0x25')][_0x91cc('0x42')]({'where':_0x2912a6,'attributes':['id',_0x91cc('0x48'),_0x91cc('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x451d9a,null))['then'](function(_0x29e091){if(_0x29e091){var _0x325a72=util[_0x91cc('0x4a')](_0x91cc('0x4b'),_0x29e091[_0x91cc('0x4c')]);if(fs[_0x91cc('0x4d')](_0x325a72)){_0x29ece5=!![];return _0x47b4c9[_0x91cc('0x4e')](_0x325a72,_0x29e091[_0x91cc('0x48')],config[_0x91cc('0x4f')][_0x91cc('0x50')])['then'](function(){return _0x29e091;});}return _0x29e091;}})[_0x91cc('0x20')](function(_0x31e780){if(_0x31e780){if(!fs[_0x91cc('0x4d')](_0x31e780[_0x91cc('0x48')])){throw new db[(_0x91cc('0x51'))][(_0x91cc('0x52'))](_0x91cc('0x53'));}if(_0x31e780['filename']){return _0x451d9a[_0x91cc('0x46')](_0x31e780['savePath'],_0x31e780[_0x91cc('0x49')]+path[_0x91cc('0x54')](_0x31e780['savePath']),function(){if(_0x29ece5){fs[_0x91cc('0x55')](_0x31e780[_0x91cc('0x48')]);}});}else{return _0x451d9a[_0x91cc('0x46')](_0x31e780[_0x91cc('0x48')],function(_0x84321a){if(_0x29ece5){fs[_0x91cc('0x55')](_0x31e780[_0x91cc('0x48')]);}});}}})[_0x91cc('0x45')](handleError(_0x451d9a,null));};
\ No newline at end of file