Built motion from commit 4a18b36e645f5fa4a517d36f9783bde259878164. Version 3.0.0...
[motion-next.git] / server / api / cloudProvider / cloudProvider.controller.js
index d096816..952a19a 100644 (file)
@@ -1 +1 @@
-const a118_0xf33b=['json','keys','intersection','nolimit','create','include','order','key','findOne','sort','fieldName','sequelize','sendStatus','options','../../config/logger','set','rawAttributes','count','stack','fields','params','query','where','CloudProvider','offset','../../components/parsers/qs','then','limit','api','update','map','length','catch','status','Content-Range','destroy','error','pick','attributes','../../mysqldb','undefined','VIRTUAL','lodash','index','filter','filters','name','body','end','model','includeAll','merge'];(function(_0x13a7d1,_0xf33b28){const _0x2f7c2f=function(_0x463d20){while(--_0x463d20){_0x13a7d1['push'](_0x13a7d1['shift']());}};_0x2f7c2f(++_0xf33b28);}(a118_0xf33b,0x1f2));const a118_0x2f7c=function(_0x13a7d1,_0xf33b28){_0x13a7d1=_0x13a7d1-0x0;let _0x2f7c2f=a118_0xf33b[_0x13a7d1];return _0x2f7c2f;};const _0x3c8d7d=a118_0x2f7c;'use strict';const _=require(_0x3c8d7d('0xc')),qs=require(_0x3c8d7d('0x2f')),logger=require(_0x3c8d7d('0x24'))(_0x3c8d7d('0x32')),db=require(_0x3c8d7d('0x9'))['db'],{Op}=require(_0x3c8d7d('0x21'));function respondWithResult(_0x463d20,_0x111413){return _0x111413=_0x111413||0xc8,function(_0x525372){if(_0x525372)return _0x463d20['status'](_0x111413)['json'](_0x525372);};}function respondWithFilteredResult(_0x5060c9,_0x2bb739){return function(_0x316dd7){const _0x2033f7=a118_0x2f7c;if(_0x316dd7){const _0x56cefc=_0x316dd7['count'],_0x334cfd=_0x2bb739['offset'];let _0x19cff6=_0x2bb739[_0x2033f7('0x2e')]+_0x2bb739[_0x2033f7('0x31')],_0x3182eb;return _0x19cff6>=_0x56cefc?(_0x19cff6=_0x56cefc,_0x3182eb=0xc8):_0x3182eb=0xce,_0x5060c9[_0x2033f7('0x3')](_0x3182eb),_0x5060c9[_0x2033f7('0x25')](_0x2033f7('0x4'),_0x334cfd+'-'+_0x19cff6+'/'+_0x56cefc)[_0x2033f7('0x16')](_0x316dd7);}return null;};}function saveUpdates(_0x16d13a){return function(_0x258da6){const _0x2a83aa=a118_0x2f7c;if(_0x258da6)return _0x258da6['update'](_0x16d13a)[_0x2a83aa('0x30')](function(_0x784ceb){return _0x784ceb;});return null;};}function removeEntity(_0x1e11e1){return function(_0x57679c){const _0x3fd980=a118_0x2f7c;if(_0x57679c)return _0x57679c[_0x3fd980('0x5')]()[_0x3fd980('0x30')](function(){const _0x35213f=_0x3fd980;_0x1e11e1[_0x35213f('0x3')](0xcc)[_0x35213f('0x12')]();});};}function handleEntityNotFound(_0x1379fc){return function(_0x4c4876){const _0x455b60=a118_0x2f7c;return!_0x4c4876&&_0x1379fc[_0x455b60('0x22')](0x194),_0x4c4876;};}function handleError(_0x1beba0,_0x1ee9dc){return _0x1ee9dc=_0x1ee9dc||0x1f4,function(_0x710275){const _0xda080c=a118_0x2f7c;logger[_0xda080c('0x6')](_0x710275[_0xda080c('0x28')]),_0x710275[_0xda080c('0x10')]&&delete _0x710275[_0xda080c('0x10')],_0x1beba0[_0xda080c('0x3')](_0x1ee9dc)['send'](_0x710275);};}exports[_0x3c8d7d('0xd')]=function(_0xbbc2a8,_0x460a03){const _0x2cf616=_0x3c8d7d;let _0x4b1fdd={};const _0xc1af4f={},_0x2a9594={'count':0x0,'rows':[]},_0x366398=_[_0x2cf616('0x0')](db[_0x2cf616('0x2d')]['rawAttributes'],function(_0x16d966){const _0x314961=_0x2cf616;return{'name':_0x16d966[_0x314961('0x20')],'type':_0x16d966['type'][_0x314961('0x1d')]};});_0xc1af4f[_0x2cf616('0x13')]=_[_0x2cf616('0x0')](_0x366398,_0x2cf616('0x10')),_0xc1af4f['query']=_['keys'](_0xbbc2a8[_0x2cf616('0x2b')]),_0xc1af4f['filters']=_[_0x2cf616('0x18')](_0xc1af4f[_0x2cf616('0x13')],_0xc1af4f['query']),_0x4b1fdd[_0x2cf616('0x8')]=_[_0x2cf616('0x18')](_0xc1af4f[_0x2cf616('0x13')],qs[_0x2cf616('0x29')](_0xbbc2a8['query'][_0x2cf616('0x29')])),_0x4b1fdd[_0x2cf616('0x8')]=_0x4b1fdd['attributes'][_0x2cf616('0x1')]?_0x4b1fdd['attributes']:_0xc1af4f[_0x2cf616('0x13')];typeof _0xbbc2a8['query'][_0x2cf616('0x19')]===_0x2cf616('0xa')&&(_0x4b1fdd['limit']=qs[_0x2cf616('0x31')](_0xbbc2a8[_0x2cf616('0x2b')][_0x2cf616('0x31')]),_0x4b1fdd[_0x2cf616('0x2e')]=qs[_0x2cf616('0x2e')](_0xbbc2a8[_0x2cf616('0x2b')]['offset']));_0x4b1fdd[_0x2cf616('0x1c')]=qs[_0x2cf616('0x1f')](_0xbbc2a8[_0x2cf616('0x2b')][_0x2cf616('0x1f')]),_0x4b1fdd[_0x2cf616('0x2c')]=qs[_0x2cf616('0xf')](_[_0x2cf616('0x7')](_0xbbc2a8[_0x2cf616('0x2b')],_0xc1af4f[_0x2cf616('0xf')]),_0x366398);_0xbbc2a8[_0x2cf616('0x2b')][_0x2cf616('0xe')]&&(_0x4b1fdd[_0x2cf616('0x2c')]=_[_0x2cf616('0x15')](_0x4b1fdd[_0x2cf616('0x2c')],{[Op['or']]:_['map'](_0x366398,function(_0x1ac4f1){const _0x43bd40=_0x2cf616;if(_0x1ac4f1['type']!==_0x43bd40('0xb')){const _0x474181={};return _0x474181[_0x1ac4f1[_0x43bd40('0x10')]]={[Op['like']]:'%'+_0xbbc2a8[_0x43bd40('0x2b')][_0x43bd40('0xe')]+'%'},_0x474181;}})}));_0x4b1fdd=_[_0x2cf616('0x15')]({},_0x4b1fdd,_0xbbc2a8[_0x2cf616('0x23')]);const _0x3e84f6={'where':_0x4b1fdd[_0x2cf616('0x2c')]};return db[_0x2cf616('0x2d')][_0x2cf616('0x27')](_0x3e84f6)[_0x2cf616('0x30')](function(_0xf2496){const _0x624872=_0x2cf616;return _0x2a9594[_0x624872('0x27')]=_0xf2496,_0xbbc2a8['query'][_0x624872('0x14')]&&(_0x4b1fdd[_0x624872('0x1b')]=[{'all':!![]}]),db[_0x624872('0x2d')]['findAll'](_0x4b1fdd);})[_0x2cf616('0x30')](function(_0x279bda){return _0x2a9594['rows']=_0x279bda,_0x2a9594;})['then'](respondWithFilteredResult(_0x460a03,_0x4b1fdd))[_0x2cf616('0x2')](handleError(_0x460a03,null));},exports['show']=function(_0x51c42f,_0x566086){const _0x43fef1=_0x3c8d7d;let _0x58216e={'raw':!![],'where':{'id':_0x51c42f['params']['id']}};const _0x33ea31={};return _0x33ea31[_0x43fef1('0x13')]=_[_0x43fef1('0x17')](db[_0x43fef1('0x2d')][_0x43fef1('0x26')]),_0x33ea31[_0x43fef1('0x2b')]=_[_0x43fef1('0x17')](_0x51c42f[_0x43fef1('0x2b')]),_0x33ea31[_0x43fef1('0xf')]=_[_0x43fef1('0x18')](_0x33ea31[_0x43fef1('0x13')],_0x33ea31[_0x43fef1('0x2b')]),_0x58216e[_0x43fef1('0x8')]=_[_0x43fef1('0x18')](_0x33ea31[_0x43fef1('0x13')],qs[_0x43fef1('0x29')](_0x51c42f[_0x43fef1('0x2b')][_0x43fef1('0x29')])),_0x58216e['attributes']=_0x58216e[_0x43fef1('0x8')][_0x43fef1('0x1')]?_0x58216e[_0x43fef1('0x8')]:_0x33ea31['model'],_0x51c42f['query'][_0x43fef1('0x14')]&&(_0x58216e[_0x43fef1('0x1b')]=[{'all':!![]}]),_0x58216e=_[_0x43fef1('0x15')]({},_0x58216e,_0x51c42f[_0x43fef1('0x23')]),db[_0x43fef1('0x2d')][_0x43fef1('0x1e')](_0x58216e)['then'](handleEntityNotFound(_0x566086,null))[_0x43fef1('0x30')](respondWithResult(_0x566086,null))[_0x43fef1('0x2')](handleError(_0x566086,null));},exports[_0x3c8d7d('0x1a')]=function(_0x543ebd,_0x2d5061){const _0x47e5b4=_0x3c8d7d;return db[_0x47e5b4('0x2d')]['create'](_0x543ebd[_0x47e5b4('0x11')],{})['then'](respondWithResult(_0x2d5061,0xc9))[_0x47e5b4('0x2')](handleError(_0x2d5061,null));},exports[_0x3c8d7d('0x33')]=function(_0x5c5c50,_0x314b7f){const _0x144199=_0x3c8d7d;return _0x5c5c50[_0x144199('0x11')]['id']&&delete _0x5c5c50[_0x144199('0x11')]['id'],db['CloudProvider'][_0x144199('0x1e')]({'where':{'id':_0x5c5c50[_0x144199('0x2a')]['id']}})['then'](handleEntityNotFound(_0x314b7f,null))[_0x144199('0x30')](saveUpdates(_0x5c5c50[_0x144199('0x11')],null))['then'](respondWithResult(_0x314b7f,null))[_0x144199('0x2')](handleError(_0x314b7f,null));},exports['destroy']=function(_0x4cffab,_0x39d33e){const _0x34a01b=_0x3c8d7d;return db[_0x34a01b('0x2d')][_0x34a01b('0x1e')]({'where':{'id':_0x4cffab[_0x34a01b('0x2a')]['id']}})['then'](handleEntityNotFound(_0x39d33e,null))[_0x34a01b('0x30')](removeEntity(_0x39d33e,null))[_0x34a01b('0x2')](handleError(_0x39d33e,null));};
\ No newline at end of file
+const a118_0x6409=['stack','rawAttributes','map','model','filters','index','merge','include','status','Content-Range','destroy','query','../../mysqldb','type','../../config/logger','show','send','attributes','undefined','intersection','api','body','fields','lodash','pick','where','sort','order','catch','set','end','update','offset','keys','name','like','findOne','params','options','then','length','CloudProvider','nolimit','filter','create','fieldName','findAll','count','limit'];(function(_0x4bc087,_0x6409dc){const _0x47ce8b=function(_0x4a0f4d){while(--_0x4a0f4d){_0x4bc087['push'](_0x4bc087['shift']());}};_0x47ce8b(++_0x6409dc);}(a118_0x6409,0x74));const a118_0x47ce=function(_0x4bc087,_0x6409dc){_0x4bc087=_0x4bc087-0x0;let _0x47ce8b=a118_0x6409[_0x4bc087];return _0x47ce8b;};const _0xbe6836=a118_0x47ce;'use strict';const _=require(_0xbe6836('0x5')),qs=require('../../components/parsers/qs'),logger=require(_0xbe6836('0x2d'))(_0xbe6836('0x2')),db=require(_0xbe6836('0x2b'))['db'],{Op}=require('sequelize');function respondWithResult(_0x4a0f4d,_0x5a633c){return _0x5a633c=_0x5a633c||0xc8,function(_0x3f77be){const _0x1b0f4a=a118_0x47ce;if(_0x3f77be)return _0x4a0f4d[_0x1b0f4a('0x27')](_0x5a633c)['json'](_0x3f77be);};}function respondWithFilteredResult(_0x1697b5,_0xab6cd9){return function(_0x3b9b5f){const _0x2cc26b=a118_0x47ce;if(_0x3b9b5f){const _0x571194=_0x3b9b5f[_0x2cc26b('0x1d')],_0x56f649=_0xab6cd9[_0x2cc26b('0xe')];let _0x319de1=_0xab6cd9[_0x2cc26b('0xe')]+_0xab6cd9[_0x2cc26b('0x1e')],_0xae69f5;return _0x319de1>=_0x571194?(_0x319de1=_0x571194,_0xae69f5=0xc8):_0xae69f5=0xce,_0x1697b5['status'](_0xae69f5),_0x1697b5[_0x2cc26b('0xb')](_0x2cc26b('0x28'),_0x56f649+'-'+_0x319de1+'/'+_0x571194)['json'](_0x3b9b5f);}return null;};}function saveUpdates(_0xc654db){return function(_0x569fe8){const _0x2fa6cb=a118_0x47ce;if(_0x569fe8)return _0x569fe8[_0x2fa6cb('0xd')](_0xc654db)[_0x2fa6cb('0x15')](function(_0x3ae624){return _0x3ae624;});return null;};}function removeEntity(_0xee3062){return function(_0x5c0a7f){const _0x518442=a118_0x47ce;if(_0x5c0a7f)return _0x5c0a7f['destroy']()[_0x518442('0x15')](function(){const _0x5e2af3=_0x518442;_0xee3062['status'](0xcc)[_0x5e2af3('0xc')]();});};}function handleEntityNotFound(_0x110402){return function(_0x4631e8){return!_0x4631e8&&_0x110402['sendStatus'](0x194),_0x4631e8;};}function handleError(_0x2bd611,_0x221066){return _0x221066=_0x221066||0x1f4,function(_0x212959){const _0x264b84=a118_0x47ce;logger['error'](_0x212959[_0x264b84('0x1f')]),_0x212959[_0x264b84('0x10')]&&delete _0x212959[_0x264b84('0x10')],_0x2bd611[_0x264b84('0x27')](_0x221066)[_0x264b84('0x2f')](_0x212959);};}exports[_0xbe6836('0x24')]=function(_0x23c7de,_0xc36e8c){const _0x56e09a=_0xbe6836;let _0x52de9b={};const _0x5ab501={},_0x39bf7a={'count':0x0,'rows':[]},_0x19ea50=_['map'](db['CloudProvider'][_0x56e09a('0x20')],function(_0x1ca31d){const _0x509086=_0x56e09a;return{'name':_0x1ca31d[_0x509086('0x1b')],'type':_0x1ca31d['type']['key']};});_0x5ab501[_0x56e09a('0x22')]=_['map'](_0x19ea50,_0x56e09a('0x10')),_0x5ab501['query']=_[_0x56e09a('0xf')](_0x23c7de[_0x56e09a('0x2a')]),_0x5ab501[_0x56e09a('0x23')]=_[_0x56e09a('0x1')](_0x5ab501[_0x56e09a('0x22')],_0x5ab501[_0x56e09a('0x2a')]),_0x52de9b[_0x56e09a('0x30')]=_['intersection'](_0x5ab501[_0x56e09a('0x22')],qs['fields'](_0x23c7de[_0x56e09a('0x2a')]['fields'])),_0x52de9b[_0x56e09a('0x30')]=_0x52de9b[_0x56e09a('0x30')]['length']?_0x52de9b[_0x56e09a('0x30')]:_0x5ab501['model'];typeof _0x23c7de[_0x56e09a('0x2a')][_0x56e09a('0x18')]===_0x56e09a('0x0')&&(_0x52de9b[_0x56e09a('0x1e')]=qs[_0x56e09a('0x1e')](_0x23c7de[_0x56e09a('0x2a')][_0x56e09a('0x1e')]),_0x52de9b[_0x56e09a('0xe')]=qs[_0x56e09a('0xe')](_0x23c7de[_0x56e09a('0x2a')][_0x56e09a('0xe')]));_0x52de9b[_0x56e09a('0x9')]=qs[_0x56e09a('0x8')](_0x23c7de[_0x56e09a('0x2a')][_0x56e09a('0x8')]),_0x52de9b[_0x56e09a('0x7')]=qs['filters'](_[_0x56e09a('0x6')](_0x23c7de[_0x56e09a('0x2a')],_0x5ab501['filters']),_0x19ea50);_0x23c7de[_0x56e09a('0x2a')][_0x56e09a('0x19')]&&(_0x52de9b['where']=_[_0x56e09a('0x25')](_0x52de9b[_0x56e09a('0x7')],{[Op['or']]:_[_0x56e09a('0x21')](_0x19ea50,function(_0x463440){const _0x39a1d9=_0x56e09a;if(_0x463440[_0x39a1d9('0x2c')]!=='VIRTUAL'){const _0x4049c7={};return _0x4049c7[_0x463440[_0x39a1d9('0x10')]]={[Op[_0x39a1d9('0x11')]]:'%'+_0x23c7de[_0x39a1d9('0x2a')][_0x39a1d9('0x19')]+'%'},_0x4049c7;}})}));_0x52de9b=_[_0x56e09a('0x25')]({},_0x52de9b,_0x23c7de[_0x56e09a('0x14')]);const _0x4522e2={'where':_0x52de9b[_0x56e09a('0x7')]};return db[_0x56e09a('0x17')][_0x56e09a('0x1d')](_0x4522e2)[_0x56e09a('0x15')](function(_0x218d2a){const _0x15292f=_0x56e09a;return _0x39bf7a[_0x15292f('0x1d')]=_0x218d2a,_0x23c7de[_0x15292f('0x2a')]['includeAll']&&(_0x52de9b[_0x15292f('0x26')]=[{'all':!![]}]),db['CloudProvider'][_0x15292f('0x1c')](_0x52de9b);})[_0x56e09a('0x15')](function(_0xb291db){return _0x39bf7a['rows']=_0xb291db,_0x39bf7a;})[_0x56e09a('0x15')](respondWithFilteredResult(_0xc36e8c,_0x52de9b))[_0x56e09a('0xa')](handleError(_0xc36e8c,null));},exports[_0xbe6836('0x2e')]=function(_0x453781,_0x56b891){const _0x12c6fa=_0xbe6836;let _0xfcb220={'raw':!![],'where':{'id':_0x453781['params']['id']}};const _0x49fbd9={};return _0x49fbd9[_0x12c6fa('0x22')]=_[_0x12c6fa('0xf')](db['CloudProvider'][_0x12c6fa('0x20')]),_0x49fbd9[_0x12c6fa('0x2a')]=_[_0x12c6fa('0xf')](_0x453781['query']),_0x49fbd9['filters']=_[_0x12c6fa('0x1')](_0x49fbd9['model'],_0x49fbd9[_0x12c6fa('0x2a')]),_0xfcb220[_0x12c6fa('0x30')]=_[_0x12c6fa('0x1')](_0x49fbd9[_0x12c6fa('0x22')],qs['fields'](_0x453781['query'][_0x12c6fa('0x4')])),_0xfcb220[_0x12c6fa('0x30')]=_0xfcb220[_0x12c6fa('0x30')][_0x12c6fa('0x16')]?_0xfcb220[_0x12c6fa('0x30')]:_0x49fbd9[_0x12c6fa('0x22')],_0x453781[_0x12c6fa('0x2a')]['includeAll']&&(_0xfcb220[_0x12c6fa('0x26')]=[{'all':!![]}]),_0xfcb220=_['merge']({},_0xfcb220,_0x453781[_0x12c6fa('0x14')]),db['CloudProvider']['findOne'](_0xfcb220)[_0x12c6fa('0x15')](handleEntityNotFound(_0x56b891,null))[_0x12c6fa('0x15')](respondWithResult(_0x56b891,null))[_0x12c6fa('0xa')](handleError(_0x56b891,null));},exports[_0xbe6836('0x1a')]=function(_0x4209fb,_0x4c9cc0){const _0x3479d8=_0xbe6836;return db[_0x3479d8('0x17')][_0x3479d8('0x1a')](_0x4209fb[_0x3479d8('0x3')],{})[_0x3479d8('0x15')](respondWithResult(_0x4c9cc0,0xc9))[_0x3479d8('0xa')](handleError(_0x4c9cc0,null));},exports['update']=function(_0x7aa85e,_0x22f495){const _0x826a3b=_0xbe6836;return _0x7aa85e[_0x826a3b('0x3')]['id']&&delete _0x7aa85e[_0x826a3b('0x3')]['id'],db[_0x826a3b('0x17')][_0x826a3b('0x12')]({'where':{'id':_0x7aa85e[_0x826a3b('0x13')]['id']}})[_0x826a3b('0x15')](handleEntityNotFound(_0x22f495,null))[_0x826a3b('0x15')](saveUpdates(_0x7aa85e['body'],null))[_0x826a3b('0x15')](respondWithResult(_0x22f495,null))['catch'](handleError(_0x22f495,null));},exports[_0xbe6836('0x29')]=function(_0x13f5c5,_0x597ef2){const _0x2da0f2=_0xbe6836;return db[_0x2da0f2('0x17')][_0x2da0f2('0x12')]({'where':{'id':_0x13f5c5[_0x2da0f2('0x13')]['id']}})[_0x2da0f2('0x15')](handleEntityNotFound(_0x597ef2,null))[_0x2da0f2('0x15')](removeEntity(_0x597ef2,null))[_0x2da0f2('0xa')](handleError(_0x597ef2,null));};
\ No newline at end of file