Built motion from commit 459747fdfe53bbf13fbede61eeaffea1f1438f86. Version 3.0.0...
[motion-next.git] / server / api / intDeskField / intDeskField.controller.js
index c0a0120..bdd7cf6 100644 (file)
@@ -1 +1 @@
-const a238_0x6448=['filters','includeAll','index','body','rawAttributes','DeskField','pick','filter','Content-Range','api','query','fieldName','error','model','../../mysqldb','show','end','map','intersection','../../components/parsers/qs','stack','VIRTUAL','undefined','sequelize','type','order','rows','merge','count','sort','set','fields','findAll','destroy','limit','name','findOne','lodash','include','catch','json','where','update','keys','attributes','params','options','length','status','create','then','like','offset'];(function(_0x4f8d8a,_0x6448be){const _0x3f5849=function(_0x2cbcf4){while(--_0x2cbcf4){_0x4f8d8a['push'](_0x4f8d8a['shift']());}};_0x3f5849(++_0x6448be);}(a238_0x6448,0x129));const a238_0x3f58=function(_0x4f8d8a,_0x6448be){_0x4f8d8a=_0x4f8d8a-0x0;let _0x3f5849=a238_0x6448[_0x4f8d8a];return _0x3f5849;};const _0x2f06be=a238_0x3f58;'use strict';const _=require(_0x2f06be('0x5')),qs=require(_0x2f06be('0x28')),logger=require('../../config/logger')(_0x2f06be('0x1e')),db=require(_0x2f06be('0x23'))['db'],{Op}=require(_0x2f06be('0x2c'));function respondWithResult(_0x2cbcf4,_0x4c7175){return _0x4c7175=_0x4c7175||0xc8,function(_0x5506d1){const _0x22060b=a238_0x3f58;if(_0x5506d1)return _0x2cbcf4[_0x22060b('0x10')](_0x4c7175)[_0x22060b('0x8')](_0x5506d1);};}function respondWithFilteredResult(_0x2eed81,_0x4c6b57){return function(_0x10e47f){const _0x1c5cc=a238_0x3f58;if(_0x10e47f){const _0x31f843=_0x10e47f[_0x1c5cc('0x31')],_0x30727e=_0x4c6b57[_0x1c5cc('0x14')];let _0x27eb78=_0x4c6b57[_0x1c5cc('0x14')]+_0x4c6b57[_0x1c5cc('0x2')],_0x413fd0;return _0x27eb78>=_0x31f843?(_0x27eb78=_0x31f843,_0x413fd0=0xc8):_0x413fd0=0xce,_0x2eed81[_0x1c5cc('0x10')](_0x413fd0),_0x2eed81[_0x1c5cc('0x33')](_0x1c5cc('0x1d'),_0x30727e+'-'+_0x27eb78+'/'+_0x31f843)[_0x1c5cc('0x8')](_0x10e47f);}return null;};}function saveUpdates(_0x1bafd5){return function(_0x355f07){const _0x323ba5=a238_0x3f58;if(_0x355f07)return _0x355f07[_0x323ba5('0xa')](_0x1bafd5)[_0x323ba5('0x12')](function(_0x2636a0){return _0x2636a0;});return null;};}function removeEntity(_0x4cbb31){return function(_0xac082d){const _0x7942e2=a238_0x3f58;if(_0xac082d)return _0xac082d[_0x7942e2('0x1')]()[_0x7942e2('0x12')](function(){const _0x42d56b=_0x7942e2;_0x4cbb31['status'](0xcc)[_0x42d56b('0x25')]();});};}function handleEntityNotFound(_0x7e1a51){return function(_0x5bef1c){return!_0x5bef1c&&_0x7e1a51['sendStatus'](0x194),_0x5bef1c;};}function handleError(_0x5a8c72,_0xd72a24){return _0xd72a24=_0xd72a24||0x1f4,function(_0x5d4c3d){const _0x2cac53=a238_0x3f58;logger[_0x2cac53('0x21')](_0x5d4c3d[_0x2cac53('0x29')]),_0x5d4c3d[_0x2cac53('0x3')]&&delete _0x5d4c3d[_0x2cac53('0x3')],_0x5a8c72[_0x2cac53('0x10')](_0xd72a24)['send'](_0x5d4c3d);};}exports[_0x2f06be('0x17')]=function(_0x17f543,_0x1d14e0){const _0x2dfa5f=_0x2f06be;let _0x24e6db={};const _0x5b29b4={},_0x2eda5d={'count':0x0,'rows':[]},_0x48a8ae=_[_0x2dfa5f('0x26')](db['DeskField']['rawAttributes'],function(_0xa5792b){const _0x3eee1a=_0x2dfa5f;return{'name':_0xa5792b[_0x3eee1a('0x20')],'type':_0xa5792b[_0x3eee1a('0x2d')]['key']};});_0x5b29b4[_0x2dfa5f('0x22')]=_['map'](_0x48a8ae,_0x2dfa5f('0x3')),_0x5b29b4[_0x2dfa5f('0x1f')]=_[_0x2dfa5f('0xb')](_0x17f543[_0x2dfa5f('0x1f')]),_0x5b29b4[_0x2dfa5f('0x15')]=_[_0x2dfa5f('0x27')](_0x5b29b4[_0x2dfa5f('0x22')],_0x5b29b4['query']),_0x24e6db[_0x2dfa5f('0xc')]=_[_0x2dfa5f('0x27')](_0x5b29b4[_0x2dfa5f('0x22')],qs['fields'](_0x17f543[_0x2dfa5f('0x1f')][_0x2dfa5f('0x34')])),_0x24e6db[_0x2dfa5f('0xc')]=_0x24e6db[_0x2dfa5f('0xc')][_0x2dfa5f('0xf')]?_0x24e6db['attributes']:_0x5b29b4[_0x2dfa5f('0x22')];typeof _0x17f543[_0x2dfa5f('0x1f')]['nolimit']===_0x2dfa5f('0x2b')&&(_0x24e6db['limit']=qs[_0x2dfa5f('0x2')](_0x17f543[_0x2dfa5f('0x1f')][_0x2dfa5f('0x2')]),_0x24e6db[_0x2dfa5f('0x14')]=qs['offset'](_0x17f543[_0x2dfa5f('0x1f')][_0x2dfa5f('0x14')]));_0x24e6db[_0x2dfa5f('0x2e')]=qs[_0x2dfa5f('0x32')](_0x17f543[_0x2dfa5f('0x1f')][_0x2dfa5f('0x32')]),_0x24e6db['where']=qs[_0x2dfa5f('0x15')](_[_0x2dfa5f('0x1b')](_0x17f543[_0x2dfa5f('0x1f')],_0x5b29b4[_0x2dfa5f('0x15')]),_0x48a8ae);_0x17f543['query'][_0x2dfa5f('0x1c')]&&(_0x24e6db[_0x2dfa5f('0x9')]=_['merge'](_0x24e6db[_0x2dfa5f('0x9')],{[Op['or']]:_[_0x2dfa5f('0x26')](_0x48a8ae,function(_0x4035dc){const _0x793c43=_0x2dfa5f;if(_0x4035dc['type']!==_0x793c43('0x2a')){const _0x508480={};return _0x508480[_0x4035dc[_0x793c43('0x3')]]={[Op[_0x793c43('0x13')]]:'%'+_0x17f543[_0x793c43('0x1f')][_0x793c43('0x1c')]+'%'},_0x508480;}})}));_0x24e6db=_[_0x2dfa5f('0x30')]({},_0x24e6db,_0x17f543['options']);const _0x53f1f5={'where':_0x24e6db[_0x2dfa5f('0x9')]};return db[_0x2dfa5f('0x1a')][_0x2dfa5f('0x31')](_0x53f1f5)['then'](function(_0x12b8fa){const _0x341343=_0x2dfa5f;return _0x2eda5d['count']=_0x12b8fa,_0x17f543[_0x341343('0x1f')][_0x341343('0x16')]&&(_0x24e6db[_0x341343('0x6')]=[{'all':!![]}]),db[_0x341343('0x1a')][_0x341343('0x0')](_0x24e6db);})['then'](function(_0x29eadd){const _0x2630fc=_0x2dfa5f;return _0x2eda5d[_0x2630fc('0x2f')]=_0x29eadd,_0x2eda5d;})['then'](respondWithFilteredResult(_0x1d14e0,_0x24e6db))[_0x2dfa5f('0x7')](handleError(_0x1d14e0,null));},exports[_0x2f06be('0x24')]=function(_0xbe8bd7,_0x3fdd96){const _0x16274a=_0x2f06be;let _0x4e3353={'raw':!![],'where':{'id':_0xbe8bd7[_0x16274a('0xd')]['id']}};const _0x1e5466={};return _0x1e5466[_0x16274a('0x22')]=_[_0x16274a('0xb')](db['DeskField'][_0x16274a('0x19')]),_0x1e5466['query']=_['keys'](_0xbe8bd7[_0x16274a('0x1f')]),_0x1e5466[_0x16274a('0x15')]=_['intersection'](_0x1e5466[_0x16274a('0x22')],_0x1e5466[_0x16274a('0x1f')]),_0x4e3353[_0x16274a('0xc')]=_['intersection'](_0x1e5466[_0x16274a('0x22')],qs['fields'](_0xbe8bd7['query']['fields'])),_0x4e3353[_0x16274a('0xc')]=_0x4e3353['attributes'][_0x16274a('0xf')]?_0x4e3353[_0x16274a('0xc')]:_0x1e5466['model'],_0xbe8bd7['query']['includeAll']&&(_0x4e3353['include']=[{'all':!![]}]),_0x4e3353=_['merge']({},_0x4e3353,_0xbe8bd7[_0x16274a('0xe')]),db[_0x16274a('0x1a')][_0x16274a('0x4')](_0x4e3353)[_0x16274a('0x12')](handleEntityNotFound(_0x3fdd96,null))['then'](respondWithResult(_0x3fdd96,null))[_0x16274a('0x7')](handleError(_0x3fdd96,null));},exports[_0x2f06be('0x11')]=function(_0xa07259,_0x138d39){const _0xf369a4=_0x2f06be;return db[_0xf369a4('0x1a')][_0xf369a4('0x11')](_0xa07259['body'],{})[_0xf369a4('0x12')](respondWithResult(_0x138d39,0xc9))['catch'](handleError(_0x138d39,null));},exports[_0x2f06be('0xa')]=function(_0x58dfe4,_0x59505b){const _0x4d0f6e=_0x2f06be;return _0x58dfe4['body']['id']&&delete _0x58dfe4['body']['id'],db[_0x4d0f6e('0x1a')][_0x4d0f6e('0x4')]({'where':{'id':_0x58dfe4[_0x4d0f6e('0xd')]['id']}})[_0x4d0f6e('0x12')](handleEntityNotFound(_0x59505b,null))['then'](saveUpdates(_0x58dfe4[_0x4d0f6e('0x18')],null))[_0x4d0f6e('0x12')](respondWithResult(_0x59505b,null))[_0x4d0f6e('0x7')](handleError(_0x59505b,null));},exports[_0x2f06be('0x1')]=function(_0x33fa24,_0xc8edf3){const _0x1cffe1=_0x2f06be;return db[_0x1cffe1('0x1a')][_0x1cffe1('0x4')]({'where':{'id':_0x33fa24[_0x1cffe1('0xd')]['id']}})['then'](handleEntityNotFound(_0xc8edf3,null))[_0x1cffe1('0x12')](removeEntity(_0xc8edf3,null))[_0x1cffe1('0x7')](handleError(_0xc8edf3,null));};
\ No newline at end of file
+const a238_0x2877=['intersection','key','error','length','limit','end','merge','sequelize','sort','rawAttributes','lodash','api','create','include','where','json','pick','sendStatus','send','body','DeskField','count','includeAll','like','filters','model','findOne','rows','offset','params','../../mysqldb','name','undefined','update','then','keys','Content-Range','filter','index','VIRTUAL','attributes','../../components/parsers/qs','fieldName','findAll','fields','catch','status','map','type','query'];(function(_0x26e55f,_0x287775){const _0x24cc1c=function(_0x4d14b5){while(--_0x4d14b5){_0x26e55f['push'](_0x26e55f['shift']());}};_0x24cc1c(++_0x287775);}(a238_0x2877,0x147));const a238_0x24cc=function(_0x26e55f,_0x287775){_0x26e55f=_0x26e55f-0x0;let _0x24cc1c=a238_0x2877[_0x26e55f];return _0x24cc1c;};const _0x2ed1c4=a238_0x24cc;'use strict';const _=require(_0x2ed1c4('0x21')),qs=require(_0x2ed1c4('0xe')),logger=require('../../config/logger')(_0x2ed1c4('0x22')),db=require(_0x2ed1c4('0x3'))['db'],{Op}=require(_0x2ed1c4('0x1e'));function respondWithResult(_0x4d14b5,_0x516f4f){return _0x516f4f=_0x516f4f||0xc8,function(_0x1e10e4){const _0x346a6e=a238_0x24cc;if(_0x1e10e4)return _0x4d14b5[_0x346a6e('0x13')](_0x516f4f)[_0x346a6e('0x26')](_0x1e10e4);};}function respondWithFilteredResult(_0x43072d,_0x1c2722){return function(_0x3d17c9){const _0xb7bd9b=a238_0x24cc;if(_0x3d17c9){const _0x1aac8c=_0x3d17c9['count'],_0x4cdc55=_0x1c2722[_0xb7bd9b('0x1')];let _0x1e2cbf=_0x1c2722[_0xb7bd9b('0x1')]+_0x1c2722[_0xb7bd9b('0x1b')],_0x4fd99e;return _0x1e2cbf>=_0x1aac8c?(_0x1e2cbf=_0x1aac8c,_0x4fd99e=0xc8):_0x4fd99e=0xce,_0x43072d[_0xb7bd9b('0x13')](_0x4fd99e),_0x43072d['set'](_0xb7bd9b('0x9'),_0x4cdc55+'-'+_0x1e2cbf+'/'+_0x1aac8c)[_0xb7bd9b('0x26')](_0x3d17c9);}return null;};}function saveUpdates(_0x2a31c6){return function(_0x26a98a){const _0x4216f6=a238_0x24cc;if(_0x26a98a)return _0x26a98a[_0x4216f6('0x6')](_0x2a31c6)['then'](function(_0x41a00e){return _0x41a00e;});return null;};}function removeEntity(_0x32cae2){return function(_0x5b9e12){const _0x1c5620=a238_0x24cc;if(_0x5b9e12)return _0x5b9e12['destroy']()[_0x1c5620('0x7')](function(){const _0x4bc0de=_0x1c5620;_0x32cae2['status'](0xcc)[_0x4bc0de('0x1c')]();});};}function handleEntityNotFound(_0x593f66){return function(_0x3596ca){const _0x4340d2=a238_0x24cc;return!_0x3596ca&&_0x593f66[_0x4340d2('0x28')](0x194),_0x3596ca;};}function handleError(_0xe80a6b,_0xdac228){return _0xdac228=_0xdac228||0x1f4,function(_0x185185){const _0x441d45=a238_0x24cc;logger[_0x441d45('0x19')](_0x185185['stack']),_0x185185[_0x441d45('0x4')]&&delete _0x185185[_0x441d45('0x4')],_0xe80a6b[_0x441d45('0x13')](_0xdac228)[_0x441d45('0x29')](_0x185185);};}exports[_0x2ed1c4('0xb')]=function(_0x10270d,_0x1d76ba){const _0x6b638e=_0x2ed1c4;let _0x3bd284={};const _0x594753={},_0x11c386={'count':0x0,'rows':[]},_0x19f58b=_[_0x6b638e('0x14')](db['DeskField']['rawAttributes'],function(_0x4b6ee0){const _0x1e9d31=_0x6b638e;return{'name':_0x4b6ee0[_0x1e9d31('0xf')],'type':_0x4b6ee0[_0x1e9d31('0x15')][_0x1e9d31('0x18')]};});_0x594753[_0x6b638e('0x30')]=_[_0x6b638e('0x14')](_0x19f58b,_0x6b638e('0x4')),_0x594753[_0x6b638e('0x16')]=_[_0x6b638e('0x8')](_0x10270d[_0x6b638e('0x16')]),_0x594753[_0x6b638e('0x2f')]=_[_0x6b638e('0x17')](_0x594753[_0x6b638e('0x30')],_0x594753[_0x6b638e('0x16')]),_0x3bd284[_0x6b638e('0xd')]=_[_0x6b638e('0x17')](_0x594753[_0x6b638e('0x30')],qs[_0x6b638e('0x11')](_0x10270d[_0x6b638e('0x16')][_0x6b638e('0x11')])),_0x3bd284[_0x6b638e('0xd')]=_0x3bd284['attributes'][_0x6b638e('0x1a')]?_0x3bd284[_0x6b638e('0xd')]:_0x594753[_0x6b638e('0x30')];typeof _0x10270d['query']['nolimit']===_0x6b638e('0x5')&&(_0x3bd284[_0x6b638e('0x1b')]=qs[_0x6b638e('0x1b')](_0x10270d['query'][_0x6b638e('0x1b')]),_0x3bd284[_0x6b638e('0x1')]=qs[_0x6b638e('0x1')](_0x10270d[_0x6b638e('0x16')][_0x6b638e('0x1')]));_0x3bd284['order']=qs[_0x6b638e('0x1f')](_0x10270d[_0x6b638e('0x16')]['sort']),_0x3bd284[_0x6b638e('0x25')]=qs[_0x6b638e('0x2f')](_[_0x6b638e('0x27')](_0x10270d[_0x6b638e('0x16')],_0x594753[_0x6b638e('0x2f')]),_0x19f58b);_0x10270d['query'][_0x6b638e('0xa')]&&(_0x3bd284['where']=_[_0x6b638e('0x1d')](_0x3bd284[_0x6b638e('0x25')],{[Op['or']]:_[_0x6b638e('0x14')](_0x19f58b,function(_0x21b1a9){const _0x1c1a67=_0x6b638e;if(_0x21b1a9[_0x1c1a67('0x15')]!==_0x1c1a67('0xc')){const _0x544bd3={};return _0x544bd3[_0x21b1a9[_0x1c1a67('0x4')]]={[Op[_0x1c1a67('0x2e')]]:'%'+_0x10270d[_0x1c1a67('0x16')][_0x1c1a67('0xa')]+'%'},_0x544bd3;}})}));_0x3bd284=_[_0x6b638e('0x1d')]({},_0x3bd284,_0x10270d['options']);const _0x4cb6ce={'where':_0x3bd284['where']};return db[_0x6b638e('0x2b')][_0x6b638e('0x2c')](_0x4cb6ce)[_0x6b638e('0x7')](function(_0x5d9159){const _0x4bfd54=_0x6b638e;return _0x11c386['count']=_0x5d9159,_0x10270d[_0x4bfd54('0x16')][_0x4bfd54('0x2d')]&&(_0x3bd284['include']=[{'all':!![]}]),db['DeskField'][_0x4bfd54('0x10')](_0x3bd284);})[_0x6b638e('0x7')](function(_0x533bc9){const _0x4b066c=_0x6b638e;return _0x11c386[_0x4b066c('0x0')]=_0x533bc9,_0x11c386;})[_0x6b638e('0x7')](respondWithFilteredResult(_0x1d76ba,_0x3bd284))[_0x6b638e('0x12')](handleError(_0x1d76ba,null));},exports['show']=function(_0xcde37c,_0x202a20){const _0x46ca88=_0x2ed1c4;let _0x4259fe={'raw':!![],'where':{'id':_0xcde37c[_0x46ca88('0x2')]['id']}};const _0x26bdf8={};return _0x26bdf8[_0x46ca88('0x30')]=_[_0x46ca88('0x8')](db[_0x46ca88('0x2b')][_0x46ca88('0x20')]),_0x26bdf8['query']=_[_0x46ca88('0x8')](_0xcde37c[_0x46ca88('0x16')]),_0x26bdf8[_0x46ca88('0x2f')]=_['intersection'](_0x26bdf8['model'],_0x26bdf8['query']),_0x4259fe[_0x46ca88('0xd')]=_['intersection'](_0x26bdf8[_0x46ca88('0x30')],qs[_0x46ca88('0x11')](_0xcde37c[_0x46ca88('0x16')]['fields'])),_0x4259fe['attributes']=_0x4259fe[_0x46ca88('0xd')][_0x46ca88('0x1a')]?_0x4259fe[_0x46ca88('0xd')]:_0x26bdf8['model'],_0xcde37c['query'][_0x46ca88('0x2d')]&&(_0x4259fe[_0x46ca88('0x24')]=[{'all':!![]}]),_0x4259fe=_[_0x46ca88('0x1d')]({},_0x4259fe,_0xcde37c['options']),db[_0x46ca88('0x2b')][_0x46ca88('0x31')](_0x4259fe)[_0x46ca88('0x7')](handleEntityNotFound(_0x202a20,null))[_0x46ca88('0x7')](respondWithResult(_0x202a20,null))[_0x46ca88('0x12')](handleError(_0x202a20,null));},exports[_0x2ed1c4('0x23')]=function(_0x532a0a,_0x48ef23){const _0x5aaf17=_0x2ed1c4;return db[_0x5aaf17('0x2b')][_0x5aaf17('0x23')](_0x532a0a[_0x5aaf17('0x2a')],{})[_0x5aaf17('0x7')](respondWithResult(_0x48ef23,0xc9))['catch'](handleError(_0x48ef23,null));},exports[_0x2ed1c4('0x6')]=function(_0x26777,_0x3ecc04){const _0x1473a3=_0x2ed1c4;return _0x26777[_0x1473a3('0x2a')]['id']&&delete _0x26777[_0x1473a3('0x2a')]['id'],db['DeskField']['findOne']({'where':{'id':_0x26777[_0x1473a3('0x2')]['id']}})[_0x1473a3('0x7')](handleEntityNotFound(_0x3ecc04,null))['then'](saveUpdates(_0x26777['body'],null))[_0x1473a3('0x7')](respondWithResult(_0x3ecc04,null))[_0x1473a3('0x12')](handleError(_0x3ecc04,null));},exports['destroy']=function(_0x4ec547,_0x48f37d){const _0x290cac=_0x2ed1c4;return db[_0x290cac('0x2b')][_0x290cac('0x31')]({'where':{'id':_0x4ec547[_0x290cac('0x2')]['id']}})[_0x290cac('0x7')](handleEntityNotFound(_0x48f37d,null))[_0x290cac('0x7')](removeEntity(_0x48f37d,null))[_0x290cac('0x12')](handleError(_0x48f37d,null));};
\ No newline at end of file