Built motion from commit aab208717af8d15f4fa224cdb6a202877019af9b. Version 3.0.0...
[motion-next.git] / server / api / cloudProvider / cloudProvider.controller.js
index 944e0a2..43199b9 100644 (file)
@@ -1 +1 @@
-const a118_0x4705=['error','key','options','../../components/parsers/qs','Content-Range','nolimit','findOne','query','limit','destroy','catch','order','index','undefined','include','then','filter','body','keys','name','end','type','rows','merge','where','rawAttributes','count','length','status','show','filters','sendStatus','intersection','CloudProvider','../../config/logger','../../mysqldb','attributes','model','map','fields','findAll','offset','stack','create','params','includeAll','sort','update'];(function(_0x20b3e4,_0x4705db){const _0x5e1625=function(_0x89c920){while(--_0x89c920){_0x20b3e4['push'](_0x20b3e4['shift']());}};_0x5e1625(++_0x4705db);}(a118_0x4705,0xbb));const a118_0x5e16=function(_0x20b3e4,_0x4705db){_0x20b3e4=_0x20b3e4-0x0;let _0x5e1625=a118_0x4705[_0x20b3e4];return _0x5e1625;};const _0x4f30e6=a118_0x5e16;'use strict';const _=require('lodash'),qs=require(_0x4f30e6('0x8')),logger=require(_0x4f30e6('0x27'))('api'),db=require(_0x4f30e6('0x28'))['db'],{Op}=require('sequelize');function respondWithResult(_0x89c920,_0x3dd82f){return _0x3dd82f=_0x3dd82f||0xc8,function(_0x2672aa){const _0x37019c=a118_0x5e16;if(_0x2672aa)return _0x89c920[_0x37019c('0x21')](_0x3dd82f)['json'](_0x2672aa);};}function respondWithFilteredResult(_0x1765f9,_0x1f4ed1){return function(_0x54b6db){const _0x33ab4d=a118_0x5e16;if(_0x54b6db){const _0x565716=_0x54b6db[_0x33ab4d('0x1f')],_0x3a49b8=_0x1f4ed1[_0x33ab4d('0x2e')];let _0x45ae55=_0x1f4ed1['offset']+_0x1f4ed1[_0x33ab4d('0xd')],_0x4c8815;return _0x45ae55>=_0x565716?(_0x45ae55=_0x565716,_0x4c8815=0xc8):_0x4c8815=0xce,_0x1765f9[_0x33ab4d('0x21')](_0x4c8815),_0x1765f9['set'](_0x33ab4d('0x9'),_0x3a49b8+'-'+_0x45ae55+'/'+_0x565716)['json'](_0x54b6db);}return null;};}function saveUpdates(_0x2925fb){return function(_0x4b74ac){const _0x2f1740=a118_0x5e16;if(_0x4b74ac)return _0x4b74ac[_0x2f1740('0x4')](_0x2925fb)['then'](function(_0x2148ce){return _0x2148ce;});return null;};}function removeEntity(_0x3dc25c){return function(_0x574ec9){const _0x13aea4=a118_0x5e16;if(_0x574ec9)return _0x574ec9[_0x13aea4('0xe')]()[_0x13aea4('0x14')](function(){const _0x5a3534=_0x13aea4;_0x3dc25c[_0x5a3534('0x21')](0xcc)[_0x5a3534('0x19')]();});};}function handleEntityNotFound(_0x2c359f){return function(_0x4b18e7){const _0x279320=a118_0x5e16;return!_0x4b18e7&&_0x2c359f[_0x279320('0x24')](0x194),_0x4b18e7;};}function handleError(_0x397d6f,_0x3c5142){return _0x3c5142=_0x3c5142||0x1f4,function(_0x80c1d0){const _0x17a57b=a118_0x5e16;logger[_0x17a57b('0x5')](_0x80c1d0[_0x17a57b('0x2f')]),_0x80c1d0[_0x17a57b('0x18')]&&delete _0x80c1d0[_0x17a57b('0x18')],_0x397d6f[_0x17a57b('0x21')](_0x3c5142)['send'](_0x80c1d0);};}exports[_0x4f30e6('0x11')]=function(_0x18894d,_0x1f0cae){const _0x200fb3=_0x4f30e6;let _0x56a471={};const _0x31c4c7={},_0x5d273c={'count':0x0,'rows':[]},_0x26b3b5=_['map'](db[_0x200fb3('0x26')]['rawAttributes'],function(_0x5169b6){const _0x4a81e8=_0x200fb3;return{'name':_0x5169b6['fieldName'],'type':_0x5169b6[_0x4a81e8('0x1a')][_0x4a81e8('0x6')]};});_0x31c4c7[_0x200fb3('0x2a')]=_['map'](_0x26b3b5,_0x200fb3('0x18')),_0x31c4c7['query']=_[_0x200fb3('0x17')](_0x18894d[_0x200fb3('0xc')]),_0x31c4c7[_0x200fb3('0x23')]=_[_0x200fb3('0x25')](_0x31c4c7[_0x200fb3('0x2a')],_0x31c4c7['query']),_0x56a471[_0x200fb3('0x29')]=_[_0x200fb3('0x25')](_0x31c4c7[_0x200fb3('0x2a')],qs[_0x200fb3('0x2c')](_0x18894d[_0x200fb3('0xc')][_0x200fb3('0x2c')])),_0x56a471[_0x200fb3('0x29')]=_0x56a471[_0x200fb3('0x29')][_0x200fb3('0x20')]?_0x56a471['attributes']:_0x31c4c7[_0x200fb3('0x2a')];typeof _0x18894d[_0x200fb3('0xc')][_0x200fb3('0xa')]===_0x200fb3('0x12')&&(_0x56a471[_0x200fb3('0xd')]=qs[_0x200fb3('0xd')](_0x18894d[_0x200fb3('0xc')]['limit']),_0x56a471[_0x200fb3('0x2e')]=qs[_0x200fb3('0x2e')](_0x18894d[_0x200fb3('0xc')][_0x200fb3('0x2e')]));_0x56a471[_0x200fb3('0x10')]=qs[_0x200fb3('0x3')](_0x18894d['query'][_0x200fb3('0x3')]),_0x56a471[_0x200fb3('0x1d')]=qs['filters'](_['pick'](_0x18894d[_0x200fb3('0xc')],_0x31c4c7[_0x200fb3('0x23')]),_0x26b3b5);_0x18894d[_0x200fb3('0xc')][_0x200fb3('0x15')]&&(_0x56a471[_0x200fb3('0x1d')]=_[_0x200fb3('0x1c')](_0x56a471['where'],{[Op['or']]:_[_0x200fb3('0x2b')](_0x26b3b5,function(_0x8378b1){const _0x25b28c=_0x200fb3;if(_0x8378b1[_0x25b28c('0x1a')]!=='VIRTUAL'){const _0x65e763={};return _0x65e763[_0x8378b1[_0x25b28c('0x18')]]={[Op['like']]:'%'+_0x18894d[_0x25b28c('0xc')]['filter']+'%'},_0x65e763;}})}));_0x56a471=_[_0x200fb3('0x1c')]({},_0x56a471,_0x18894d[_0x200fb3('0x7')]);const _0x5a2572={'where':_0x56a471['where']};return db[_0x200fb3('0x26')][_0x200fb3('0x1f')](_0x5a2572)['then'](function(_0x4b0f16){const _0x4d288b=_0x200fb3;return _0x5d273c[_0x4d288b('0x1f')]=_0x4b0f16,_0x18894d['query'][_0x4d288b('0x2')]&&(_0x56a471[_0x4d288b('0x13')]=[{'all':!![]}]),db[_0x4d288b('0x26')][_0x4d288b('0x2d')](_0x56a471);})[_0x200fb3('0x14')](function(_0x4bcc24){const _0xc3b9c5=_0x200fb3;return _0x5d273c[_0xc3b9c5('0x1b')]=_0x4bcc24,_0x5d273c;})[_0x200fb3('0x14')](respondWithFilteredResult(_0x1f0cae,_0x56a471))[_0x200fb3('0xf')](handleError(_0x1f0cae,null));},exports[_0x4f30e6('0x22')]=function(_0x25650f,_0x516613){const _0x1618af=_0x4f30e6;let _0x217cdd={'raw':!![],'where':{'id':_0x25650f[_0x1618af('0x1')]['id']}};const _0x4c07d5={};return _0x4c07d5['model']=_[_0x1618af('0x17')](db['CloudProvider'][_0x1618af('0x1e')]),_0x4c07d5[_0x1618af('0xc')]=_[_0x1618af('0x17')](_0x25650f[_0x1618af('0xc')]),_0x4c07d5[_0x1618af('0x23')]=_[_0x1618af('0x25')](_0x4c07d5[_0x1618af('0x2a')],_0x4c07d5['query']),_0x217cdd[_0x1618af('0x29')]=_[_0x1618af('0x25')](_0x4c07d5['model'],qs[_0x1618af('0x2c')](_0x25650f[_0x1618af('0xc')][_0x1618af('0x2c')])),_0x217cdd[_0x1618af('0x29')]=_0x217cdd[_0x1618af('0x29')][_0x1618af('0x20')]?_0x217cdd[_0x1618af('0x29')]:_0x4c07d5['model'],_0x25650f[_0x1618af('0xc')][_0x1618af('0x2')]&&(_0x217cdd[_0x1618af('0x13')]=[{'all':!![]}]),_0x217cdd=_[_0x1618af('0x1c')]({},_0x217cdd,_0x25650f[_0x1618af('0x7')]),db[_0x1618af('0x26')][_0x1618af('0xb')](_0x217cdd)[_0x1618af('0x14')](handleEntityNotFound(_0x516613,null))[_0x1618af('0x14')](respondWithResult(_0x516613,null))[_0x1618af('0xf')](handleError(_0x516613,null));},exports[_0x4f30e6('0x0')]=function(_0x53d2b0,_0x540944){const _0x400419=_0x4f30e6;return db['CloudProvider'][_0x400419('0x0')](_0x53d2b0[_0x400419('0x16')],{})[_0x400419('0x14')](respondWithResult(_0x540944,0xc9))[_0x400419('0xf')](handleError(_0x540944,null));},exports[_0x4f30e6('0x4')]=function(_0x150b63,_0x24d005){const _0x1b8d64=_0x4f30e6;return _0x150b63[_0x1b8d64('0x16')]['id']&&delete _0x150b63[_0x1b8d64('0x16')]['id'],db[_0x1b8d64('0x26')]['findOne']({'where':{'id':_0x150b63[_0x1b8d64('0x1')]['id']}})[_0x1b8d64('0x14')](handleEntityNotFound(_0x24d005,null))['then'](saveUpdates(_0x150b63[_0x1b8d64('0x16')],null))[_0x1b8d64('0x14')](respondWithResult(_0x24d005,null))[_0x1b8d64('0xf')](handleError(_0x24d005,null));},exports[_0x4f30e6('0xe')]=function(_0x1961b1,_0x2ade3f){const _0x261542=_0x4f30e6;return db[_0x261542('0x26')][_0x261542('0xb')]({'where':{'id':_0x1961b1[_0x261542('0x1')]['id']}})['then'](handleEntityNotFound(_0x2ade3f,null))['then'](removeEntity(_0x2ade3f,null))[_0x261542('0xf')](handleError(_0x2ade3f,null));};
\ No newline at end of file
+const a118_0x53c5=['count','../../components/parsers/qs','api','fields','pick','status','intersection','VIRTUAL','offset','send','length','filters','include','update','set','type','where','options','then','name','findOne','map','order','rows','body','destroy','key','CloudProvider','fieldName','like','keys','stack','error','rawAttributes','filter','sendStatus','sequelize','sort','limit','index','attributes','nolimit','Content-Range','query','undefined','catch','json','../../mysqldb','params','../../config/logger','create','merge','model'];(function(_0x4607ef,_0x53c5ee){const _0x5f526d=function(_0x2f07f6){while(--_0x2f07f6){_0x4607ef['push'](_0x4607ef['shift']());}};_0x5f526d(++_0x53c5ee);}(a118_0x53c5,0x1a2));const a118_0x5f52=function(_0x4607ef,_0x53c5ee){_0x4607ef=_0x4607ef-0x0;let _0x5f526d=a118_0x53c5[_0x4607ef];return _0x5f526d;};const _0x6e122e=a118_0x5f52;'use strict';const _=require('lodash'),qs=require(_0x6e122e('0x7')),logger=require(_0x6e122e('0x2'))(_0x6e122e('0x8')),db=require(_0x6e122e('0x0'))['db'],{Op}=require(_0x6e122e('0x2a'));function respondWithResult(_0x2f07f6,_0x35c41d){return _0x35c41d=_0x35c41d||0xc8,function(_0x19c4c5){const _0x5d1847=a118_0x5f52;if(_0x19c4c5)return _0x2f07f6[_0x5d1847('0xb')](_0x35c41d)[_0x5d1847('0x34')](_0x19c4c5);};}function respondWithFilteredResult(_0xae534f,_0x297dc1){return function(_0x2b53b3){const _0x18c86b=a118_0x5f52;if(_0x2b53b3){const _0x24836b=_0x2b53b3[_0x18c86b('0x6')],_0x21c3cb=_0x297dc1['offset'];let _0x1ca2c1=_0x297dc1[_0x18c86b('0xe')]+_0x297dc1[_0x18c86b('0x2c')],_0x2b27a2;return _0x1ca2c1>=_0x24836b?(_0x1ca2c1=_0x24836b,_0x2b27a2=0xc8):_0x2b27a2=0xce,_0xae534f[_0x18c86b('0xb')](_0x2b27a2),_0xae534f[_0x18c86b('0x14')](_0x18c86b('0x30'),_0x21c3cb+'-'+_0x1ca2c1+'/'+_0x24836b)[_0x18c86b('0x34')](_0x2b53b3);}return null;};}function saveUpdates(_0x632c9b){return function(_0x130c48){const _0x180b9a=a118_0x5f52;if(_0x130c48)return _0x130c48[_0x180b9a('0x13')](_0x632c9b)[_0x180b9a('0x18')](function(_0x474d0d){return _0x474d0d;});return null;};}function removeEntity(_0x5d22a5){return function(_0x54ebc9){const _0x602d81=a118_0x5f52;if(_0x54ebc9)return _0x54ebc9[_0x602d81('0x1f')]()['then'](function(){const _0x3246c0=_0x602d81;_0x5d22a5[_0x3246c0('0xb')](0xcc)['end']();});};}function handleEntityNotFound(_0x20c4cc){return function(_0x4e61fc){const _0x14d703=a118_0x5f52;return!_0x4e61fc&&_0x20c4cc[_0x14d703('0x29')](0x194),_0x4e61fc;};}function handleError(_0x3c05fa,_0x28746e){return _0x28746e=_0x28746e||0x1f4,function(_0x24c3e7){const _0x353b19=a118_0x5f52;logger[_0x353b19('0x26')](_0x24c3e7[_0x353b19('0x25')]),_0x24c3e7[_0x353b19('0x19')]&&delete _0x24c3e7[_0x353b19('0x19')],_0x3c05fa['status'](_0x28746e)[_0x353b19('0xf')](_0x24c3e7);};}exports[_0x6e122e('0x2d')]=function(_0xb08137,_0xbc9728){const _0x2e7b22=_0x6e122e;let _0x24265c={};const _0x121dce={},_0x2a44fc={'count':0x0,'rows':[]},_0x4c0c0f=_[_0x2e7b22('0x1b')](db[_0x2e7b22('0x21')][_0x2e7b22('0x27')],function(_0x1b308b){const _0x543a71=_0x2e7b22;return{'name':_0x1b308b[_0x543a71('0x22')],'type':_0x1b308b[_0x543a71('0x15')][_0x543a71('0x20')]};});_0x121dce[_0x2e7b22('0x5')]=_['map'](_0x4c0c0f,_0x2e7b22('0x19')),_0x121dce['query']=_['keys'](_0xb08137[_0x2e7b22('0x31')]),_0x121dce[_0x2e7b22('0x11')]=_[_0x2e7b22('0xc')](_0x121dce['model'],_0x121dce[_0x2e7b22('0x31')]),_0x24265c[_0x2e7b22('0x2e')]=_[_0x2e7b22('0xc')](_0x121dce['model'],qs[_0x2e7b22('0x9')](_0xb08137[_0x2e7b22('0x31')][_0x2e7b22('0x9')])),_0x24265c[_0x2e7b22('0x2e')]=_0x24265c[_0x2e7b22('0x2e')]['length']?_0x24265c['attributes']:_0x121dce['model'];typeof _0xb08137[_0x2e7b22('0x31')][_0x2e7b22('0x2f')]===_0x2e7b22('0x32')&&(_0x24265c[_0x2e7b22('0x2c')]=qs['limit'](_0xb08137['query'][_0x2e7b22('0x2c')]),_0x24265c[_0x2e7b22('0xe')]=qs[_0x2e7b22('0xe')](_0xb08137[_0x2e7b22('0x31')][_0x2e7b22('0xe')]));_0x24265c[_0x2e7b22('0x1c')]=qs[_0x2e7b22('0x2b')](_0xb08137['query'][_0x2e7b22('0x2b')]),_0x24265c[_0x2e7b22('0x16')]=qs[_0x2e7b22('0x11')](_[_0x2e7b22('0xa')](_0xb08137[_0x2e7b22('0x31')],_0x121dce[_0x2e7b22('0x11')]),_0x4c0c0f);_0xb08137[_0x2e7b22('0x31')][_0x2e7b22('0x28')]&&(_0x24265c['where']=_[_0x2e7b22('0x4')](_0x24265c['where'],{[Op['or']]:_[_0x2e7b22('0x1b')](_0x4c0c0f,function(_0x58ea5f){const _0xe1f623=_0x2e7b22;if(_0x58ea5f['type']!==_0xe1f623('0xd')){const _0x5ad261={};return _0x5ad261[_0x58ea5f[_0xe1f623('0x19')]]={[Op[_0xe1f623('0x23')]]:'%'+_0xb08137[_0xe1f623('0x31')][_0xe1f623('0x28')]+'%'},_0x5ad261;}})}));_0x24265c=_[_0x2e7b22('0x4')]({},_0x24265c,_0xb08137[_0x2e7b22('0x17')]);const _0x741204={'where':_0x24265c[_0x2e7b22('0x16')]};return db[_0x2e7b22('0x21')]['count'](_0x741204)[_0x2e7b22('0x18')](function(_0x428220){const _0x189f77=_0x2e7b22;return _0x2a44fc['count']=_0x428220,_0xb08137[_0x189f77('0x31')]['includeAll']&&(_0x24265c[_0x189f77('0x12')]=[{'all':!![]}]),db[_0x189f77('0x21')]['findAll'](_0x24265c);})[_0x2e7b22('0x18')](function(_0x564423){const _0x1f5cce=_0x2e7b22;return _0x2a44fc[_0x1f5cce('0x1d')]=_0x564423,_0x2a44fc;})[_0x2e7b22('0x18')](respondWithFilteredResult(_0xbc9728,_0x24265c))[_0x2e7b22('0x33')](handleError(_0xbc9728,null));},exports['show']=function(_0x483127,_0x4a6eb5){const _0x3b8381=_0x6e122e;let _0x5a549d={'raw':!![],'where':{'id':_0x483127[_0x3b8381('0x1')]['id']}};const _0x2b663d={};return _0x2b663d[_0x3b8381('0x5')]=_[_0x3b8381('0x24')](db[_0x3b8381('0x21')][_0x3b8381('0x27')]),_0x2b663d[_0x3b8381('0x31')]=_[_0x3b8381('0x24')](_0x483127['query']),_0x2b663d[_0x3b8381('0x11')]=_[_0x3b8381('0xc')](_0x2b663d['model'],_0x2b663d[_0x3b8381('0x31')]),_0x5a549d['attributes']=_[_0x3b8381('0xc')](_0x2b663d[_0x3b8381('0x5')],qs[_0x3b8381('0x9')](_0x483127[_0x3b8381('0x31')][_0x3b8381('0x9')])),_0x5a549d[_0x3b8381('0x2e')]=_0x5a549d['attributes'][_0x3b8381('0x10')]?_0x5a549d[_0x3b8381('0x2e')]:_0x2b663d[_0x3b8381('0x5')],_0x483127[_0x3b8381('0x31')]['includeAll']&&(_0x5a549d[_0x3b8381('0x12')]=[{'all':!![]}]),_0x5a549d=_[_0x3b8381('0x4')]({},_0x5a549d,_0x483127[_0x3b8381('0x17')]),db[_0x3b8381('0x21')][_0x3b8381('0x1a')](_0x5a549d)[_0x3b8381('0x18')](handleEntityNotFound(_0x4a6eb5,null))[_0x3b8381('0x18')](respondWithResult(_0x4a6eb5,null))[_0x3b8381('0x33')](handleError(_0x4a6eb5,null));},exports[_0x6e122e('0x3')]=function(_0x339d86,_0x5deb15){const _0x1b5d3f=_0x6e122e;return db[_0x1b5d3f('0x21')][_0x1b5d3f('0x3')](_0x339d86[_0x1b5d3f('0x1e')],{})['then'](respondWithResult(_0x5deb15,0xc9))[_0x1b5d3f('0x33')](handleError(_0x5deb15,null));},exports['update']=function(_0x2eeb17,_0x208357){const _0x329f28=_0x6e122e;return _0x2eeb17[_0x329f28('0x1e')]['id']&&delete _0x2eeb17[_0x329f28('0x1e')]['id'],db['CloudProvider'][_0x329f28('0x1a')]({'where':{'id':_0x2eeb17[_0x329f28('0x1')]['id']}})[_0x329f28('0x18')](handleEntityNotFound(_0x208357,null))[_0x329f28('0x18')](saveUpdates(_0x2eeb17[_0x329f28('0x1e')],null))[_0x329f28('0x18')](respondWithResult(_0x208357,null))[_0x329f28('0x33')](handleError(_0x208357,null));},exports['destroy']=function(_0x3a4743,_0x97d261){const _0x5cba6c=_0x6e122e;return db[_0x5cba6c('0x21')]['findOne']({'where':{'id':_0x3a4743[_0x5cba6c('0x1')]['id']}})[_0x5cba6c('0x18')](handleEntityNotFound(_0x97d261,null))[_0x5cba6c('0x18')](removeEntity(_0x97d261,null))[_0x5cba6c('0x33')](handleError(_0x97d261,null));};
\ No newline at end of file