Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / interval / interval.controller.js
index e32ae30..6d74052 100644 (file)
@@ -1 +1 @@
-const a367_0xde6f=['filters','include','transaction','destroy','../../config/logger','../../mysqldb','order','then','name','Unable\x20to\x20retrieve\x20the\x20current\x20user','type','lodash','like','keys','fieldName','Content-Range','index','sendStatus','UserProfileSection','VIRTUAL','body','bulkCreate','query','catch','fields','attributes','findOne','options','update','user','merge','sequelize','../../components/parsers/qs','findAll','getIntervals','autoAssociation','offset','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','intersection','params','count','includeAll','Intervals','nolimit','pick','role','addInterval','map','create','status','sort','limit','where','userProfileId','filter','Interval','UserProfileResource','model','show','json','get','IntervalId','rawAttributes','error','undefined'];(function(_0x18eed5,_0xde6f07){const _0x2b50af=function(_0x5f3629){while(--_0x5f3629){_0x18eed5['push'](_0x18eed5['shift']());}};_0x2b50af(++_0xde6f07);}(a367_0xde6f,0x1a7));const a367_0x2b50=function(_0x18eed5,_0xde6f07){_0x18eed5=_0x18eed5-0x0;let _0x2b50af=a367_0xde6f[_0x18eed5];return _0x2b50af;};const _0x5d94f3=a367_0x2b50;'use strict';const _=require(_0x5d94f3('0x32')),qs=require(_0x5d94f3('0x5')),logger=require(_0x5d94f3('0x2b'))('api'),db=require(_0x5d94f3('0x2c'))['db'],{Op}=require(_0x5d94f3('0x4'));function respondWithResult(_0x5f3629,_0x31f95d){return _0x31f95d=_0x31f95d||0xc8,function(_0x5b8a3b){const _0xa4ec9a=a367_0x2b50;if(_0x5b8a3b)return _0x5f3629[_0xa4ec9a('0x17')](_0x31f95d)['json'](_0x5b8a3b);};}function respondWithFilteredResult(_0x228371,_0x13931b){return function(_0x1a6ef9){const _0x5f3b1f=a367_0x2b50;if(_0x1a6ef9){const _0x547c56=_0x1a6ef9['count'],_0x725ee8=_0x13931b[_0x5f3b1f('0x9')];let _0x34bc08=_0x13931b[_0x5f3b1f('0x9')]+_0x13931b[_0x5f3b1f('0x19')],_0x2e5f1f;return _0x34bc08>=_0x547c56?(_0x34bc08=_0x547c56,_0x2e5f1f=0xc8):_0x2e5f1f=0xce,_0x228371[_0x5f3b1f('0x17')](_0x2e5f1f),_0x228371['set'](_0x5f3b1f('0x36'),_0x725ee8+'-'+_0x34bc08+'/'+_0x547c56)[_0x5f3b1f('0x21')](_0x1a6ef9);}return null;};}function saveUpdates(_0x583ee2){return function(_0x3dec81){const _0x998241=a367_0x2b50;if(_0x3dec81)return _0x3dec81[_0x998241('0x1')](_0x583ee2)[_0x998241('0x2e')](function(_0x2c73a3){return _0x2c73a3;});return null;};}function removeEntity(_0x3d130e){return function(_0x461291){const _0xb0f793=a367_0x2b50;if(_0x461291)return _0x461291[_0xb0f793('0x2a')]()[_0xb0f793('0x2e')](function(){const _0x4306f9=_0xb0f793,_0x22e10c=_0x461291[_0x4306f9('0x22')]({'plain':!![]}),_0x49f0e8=_0x4306f9('0x10');return db[_0x4306f9('0x1e')][_0x4306f9('0x2a')]({'where':{'type':_0x49f0e8,'resourceId':_0x22e10c['id']}})[_0x4306f9('0x2e')](function(){return _0x461291;});})['then'](function(){const _0x380524=_0xb0f793;_0x3d130e[_0x380524('0x17')](0xcc)['end']();});};}function handleEntityNotFound(_0x320fd4){return function(_0x39e13d){const _0x1d5d80=a367_0x2b50;return!_0x39e13d&&_0x320fd4[_0x1d5d80('0x38')](0x194),_0x39e13d;};}function handleError(_0xd1a477,_0x3c9312){return _0x3c9312=_0x3c9312||0x1f4,function(_0x4ea26f){const _0x234fe3=a367_0x2b50;logger[_0x234fe3('0x25')](_0x4ea26f['stack']),_0x4ea26f[_0x234fe3('0x2f')]&&delete _0x4ea26f[_0x234fe3('0x2f')],_0xd1a477['status'](_0x3c9312)['send'](_0x4ea26f);};}exports[_0x5d94f3('0x37')]=function(_0x301a70,_0x47e7ec){const _0x45303c=_0x5d94f3;let _0x1a798a={};const _0x1843b8={},_0x26289c={'count':0x0,'rows':[]},_0x23ca1d=_[_0x45303c('0x15')](db['Interval'][_0x45303c('0x24')],function(_0x502979){const _0x444858=_0x45303c;return{'name':_0x502979[_0x444858('0x35')],'type':_0x502979[_0x444858('0x31')]['key']};});_0x1843b8['model']=_[_0x45303c('0x15')](_0x23ca1d,_0x45303c('0x2f')),_0x1843b8[_0x45303c('0x3d')]=_['keys'](_0x301a70[_0x45303c('0x3d')]),_0x1843b8[_0x45303c('0x27')]=_[_0x45303c('0xc')](_0x1843b8['model'],_0x1843b8['query']),_0x1a798a[_0x45303c('0x40')]=_[_0x45303c('0xc')](_0x1843b8[_0x45303c('0x1f')],qs['fields'](_0x301a70[_0x45303c('0x3d')]['fields'])),_0x1a798a[_0x45303c('0x40')]=_0x1a798a[_0x45303c('0x40')][_0x45303c('0xb')]?_0x1a798a['attributes']:_0x1843b8[_0x45303c('0x1f')];typeof _0x301a70[_0x45303c('0x3d')]['nolimit']===_0x45303c('0x26')&&(_0x1a798a[_0x45303c('0x19')]=qs['limit'](_0x301a70[_0x45303c('0x3d')][_0x45303c('0x19')]),_0x1a798a[_0x45303c('0x9')]=qs[_0x45303c('0x9')](_0x301a70[_0x45303c('0x3d')][_0x45303c('0x9')]));_0x1a798a[_0x45303c('0x2d')]=qs[_0x45303c('0x18')](_0x301a70[_0x45303c('0x3d')][_0x45303c('0x18')]),_0x1a798a[_0x45303c('0x1a')]=qs[_0x45303c('0x27')](_[_0x45303c('0x12')](_0x301a70[_0x45303c('0x3d')],_0x1843b8[_0x45303c('0x27')]),_0x23ca1d);_0x301a70[_0x45303c('0x3d')][_0x45303c('0x1c')]&&(_0x1a798a[_0x45303c('0x1a')]=_[_0x45303c('0x3')](_0x1a798a['where'],{[Op['or']]:_[_0x45303c('0x15')](_0x23ca1d,function(_0x2fed10){const _0x250693=_0x45303c;if(_0x2fed10[_0x250693('0x31')]!==_0x250693('0x3a')){const _0x5cc2ed={};return _0x5cc2ed[_0x2fed10[_0x250693('0x2f')]]={[Op[_0x250693('0x33')]]:'%'+_0x301a70[_0x250693('0x3d')]['filter']+'%'},_0x5cc2ed;}})}));_0x1a798a=_[_0x45303c('0x3')]({},_0x1a798a,_0x301a70[_0x45303c('0x0')]);const _0x2a9e8c={'where':_0x1a798a[_0x45303c('0x1a')]};return db[_0x45303c('0x1d')][_0x45303c('0xe')](_0x2a9e8c)[_0x45303c('0x2e')](function(_0x21a451){const _0x19b8a6=_0x45303c;return _0x26289c[_0x19b8a6('0xe')]=_0x21a451,_0x301a70[_0x19b8a6('0x3d')][_0x19b8a6('0xf')]&&(_0x1a798a[_0x19b8a6('0x28')]=[{'all':!![]}]),db[_0x19b8a6('0x1d')][_0x19b8a6('0x6')](_0x1a798a);})['then'](function(_0xa3d04e){return _0x26289c['rows']=_0xa3d04e,_0x26289c;})[_0x45303c('0x2e')](respondWithFilteredResult(_0x47e7ec,_0x1a798a))[_0x45303c('0x3e')](handleError(_0x47e7ec,null));},exports[_0x5d94f3('0x20')]=function(_0x45426f,_0x439cfd){const _0x3db788=_0x5d94f3;let _0x3a0251={'raw':!![],'where':{'id':_0x45426f[_0x3db788('0xd')]['id']}};const _0x20ef8c={};return _0x20ef8c['model']=_['keys'](db[_0x3db788('0x1d')][_0x3db788('0x24')]),_0x20ef8c[_0x3db788('0x3d')]=_[_0x3db788('0x34')](_0x45426f['query']),_0x20ef8c['filters']=_[_0x3db788('0xc')](_0x20ef8c[_0x3db788('0x1f')],_0x20ef8c[_0x3db788('0x3d')]),_0x3a0251[_0x3db788('0x40')]=_[_0x3db788('0xc')](_0x20ef8c[_0x3db788('0x1f')],qs['fields'](_0x45426f[_0x3db788('0x3d')][_0x3db788('0x3f')])),_0x3a0251[_0x3db788('0x40')]=_0x3a0251[_0x3db788('0x40')]['length']?_0x3a0251[_0x3db788('0x40')]:_0x20ef8c[_0x3db788('0x1f')],_0x45426f[_0x3db788('0x3d')][_0x3db788('0xf')]&&(_0x3a0251[_0x3db788('0x28')]=[{'all':!![]}]),_0x3a0251=_[_0x3db788('0x3')]({},_0x3a0251,_0x45426f[_0x3db788('0x0')]),db[_0x3db788('0x1d')][_0x3db788('0x41')](_0x3a0251)['then'](handleEntityNotFound(_0x439cfd,null))[_0x3db788('0x2e')](respondWithResult(_0x439cfd,null))[_0x3db788('0x3e')](handleError(_0x439cfd,null));},exports[_0x5d94f3('0x16')]=function(_0x1805c7,_0x4705ef){const _0x1a370d=_0x5d94f3;return db[_0x1a370d('0x1d')][_0x1a370d('0x16')](_0x1805c7[_0x1a370d('0x3b')],{})[_0x1a370d('0x2e')](function(_0x2974db){const _0x834255=_0x1a370d,_0x1c8da4=_0x1805c7[_0x834255('0x2')][_0x834255('0x22')]({'plain':!![]});if(!_0x1c8da4)throw new Error(_0x834255('0x30'));if(_0x1c8da4[_0x834255('0x13')]===_0x834255('0x2')){const _0x8d34a9=_0x2974db[_0x834255('0x22')]({'plain':!![]}),_0x50e5ea=_0x834255('0x10');return db[_0x834255('0x39')][_0x834255('0x41')]({'where':{'name':_0x50e5ea,'userProfileId':_0x1c8da4[_0x834255('0x1b')]},'raw':!![]})['then'](function(_0x132eab){const _0x2d31a=_0x834255;return _0x132eab&&_0x132eab[_0x2d31a('0x8')]===0x0?db['UserProfileResource'][_0x2d31a('0x16')]({'name':_0x8d34a9['name'],'resourceId':_0x8d34a9['id'],'type':_0x132eab[_0x2d31a('0x2f')],'sectionId':_0x132eab['id']},{})[_0x2d31a('0x2e')](function(){return _0x2974db;}):_0x2974db;})[_0x834255('0x3e')](function(_0x2d0456){const _0x2f0359=_0x834255;logger['error'](_0x2f0359('0xa'),_0x2d0456);throw _0x2d0456;});}return _0x2974db;})[_0x1a370d('0x2e')](respondWithResult(_0x4705ef,0xc9))['catch'](handleError(_0x4705ef,null));},exports['update']=function(_0x436d46,_0x175f54){const _0x2986c9=_0x5d94f3;return _0x436d46[_0x2986c9('0x3b')]['id']&&delete _0x436d46[_0x2986c9('0x3b')]['id'],db[_0x2986c9('0x1d')][_0x2986c9('0x41')]({'where':{'id':_0x436d46[_0x2986c9('0xd')]['id']}})[_0x2986c9('0x2e')](handleEntityNotFound(_0x175f54,null))[_0x2986c9('0x2e')](saveUpdates(_0x436d46[_0x2986c9('0x3b')],null))[_0x2986c9('0x2e')](respondWithResult(_0x175f54,null))[_0x2986c9('0x3e')](handleError(_0x175f54,null));},exports[_0x5d94f3('0x2a')]=function(_0x3f61f3,_0x30ce45){const _0x3ead9f=_0x5d94f3;return db[_0x3ead9f('0x1d')][_0x3ead9f('0x41')]({'where':{'id':_0x3f61f3['params']['id']}})[_0x3ead9f('0x2e')](handleEntityNotFound(_0x30ce45,null))['then'](removeEntity(_0x30ce45,null))[_0x3ead9f('0x3e')](handleError(_0x30ce45,null));},exports[_0x5d94f3('0x14')]=function(_0x3dc410,_0x3d78f4){const _0x497f78=_0x5d94f3;return _0x3dc410[_0x497f78('0x3b')]['id']&&delete _0x3dc410[_0x497f78('0x3b')]['id'],db['Interval'][_0x497f78('0x41')]({'where':{'id':_0x3dc410[_0x497f78('0xd')]['id']}})['then'](handleEntityNotFound(_0x3d78f4,null))[_0x497f78('0x2e')](function(_0x5be463){const _0x266ea7=_0x497f78;if(_0x5be463)return _0x3dc410[_0x266ea7('0x3b')][_0x266ea7('0x23')]=_0x5be463['id'],db[_0x266ea7('0x1d')][_0x266ea7('0x16')](_0x3dc410[_0x266ea7('0x3b')]);})[_0x497f78('0x2e')](respondWithResult(_0x3d78f4,null))[_0x497f78('0x3e')](handleError(_0x3d78f4,null));},exports[_0x5d94f3('0x7')]=function(_0x102a48,_0x4eab2a){const _0x58d606=_0x5d94f3;let _0x5a5495={};const _0x25e0a6={};let _0x58c472,_0x4b265c;return db['Interval'][_0x58d606('0x41')]({'where':{'id':_0x102a48[_0x58d606('0xd')]['id']}})[_0x58d606('0x2e')](handleEntityNotFound(_0x4eab2a,null))['then'](function(_0x48f89b){const _0x4b50c4=_0x58d606;if(_0x48f89b)return _0x58c472=_0x48f89b,_0x25e0a6[_0x4b50c4('0x1f')]=_[_0x4b50c4('0x34')](db[_0x4b50c4('0x1d')][_0x4b50c4('0x24')]),_0x25e0a6[_0x4b50c4('0x3d')]=_[_0x4b50c4('0x34')](_0x102a48[_0x4b50c4('0x3d')]),_0x25e0a6[_0x4b50c4('0x27')]=_[_0x4b50c4('0xc')](_0x25e0a6[_0x4b50c4('0x1f')],_0x25e0a6['query']),_0x5a5495[_0x4b50c4('0x40')]=_['intersection'](_0x25e0a6[_0x4b50c4('0x1f')],qs[_0x4b50c4('0x3f')](_0x102a48[_0x4b50c4('0x3d')][_0x4b50c4('0x3f')])),_0x5a5495['attributes']=_0x5a5495['attributes']['length']?_0x5a5495[_0x4b50c4('0x40')]:_0x25e0a6['model'],_0x5a5495[_0x4b50c4('0x2d')]=qs[_0x4b50c4('0x18')](_0x102a48[_0x4b50c4('0x3d')][_0x4b50c4('0x18')]),_0x5a5495[_0x4b50c4('0x1a')]=qs[_0x4b50c4('0x27')](_['pick'](_0x102a48[_0x4b50c4('0x3d')],_0x25e0a6[_0x4b50c4('0x27')])),_0x102a48[_0x4b50c4('0x3d')][_0x4b50c4('0x1c')]&&(_0x5a5495[_0x4b50c4('0x1a')]=_[_0x4b50c4('0x3')](_0x5a5495[_0x4b50c4('0x1a')],{[Op['or']]:_['map'](_0x5a5495[_0x4b50c4('0x40')],function(_0x529f9c){const _0x4ef8af=_0x4b50c4,_0x48341b={};return _0x48341b[_0x529f9c]={[Op[_0x4ef8af('0x33')]]:'%'+_0x102a48[_0x4ef8af('0x3d')][_0x4ef8af('0x1c')]+'%'},_0x48341b;})})),_0x5a5495=_[_0x4b50c4('0x3')]({},_0x5a5495,_0x102a48['options']),_0x58c472[_0x4b50c4('0x7')](_0x5a5495);})[_0x58d606('0x2e')](function(_0x3a3619){const _0x1a14ed=_0x58d606;if(_0x3a3619)return _0x4b265c=_0x3a3619[_0x1a14ed('0xb')],typeof _0x102a48[_0x1a14ed('0x3d')][_0x1a14ed('0x11')]===_0x1a14ed('0x26')&&(_0x5a5495[_0x1a14ed('0x19')]=qs[_0x1a14ed('0x19')](_0x102a48[_0x1a14ed('0x3d')][_0x1a14ed('0x19')]),_0x5a5495[_0x1a14ed('0x9')]=qs[_0x1a14ed('0x9')](_0x102a48[_0x1a14ed('0x3d')][_0x1a14ed('0x9')])),_0x58c472[_0x1a14ed('0x7')](_0x5a5495);})[_0x58d606('0x2e')](function(_0x10d6f1){if(_0x10d6f1)return _0x10d6f1?{'count':_0x4b265c,'rows':_0x10d6f1}:null;})[_0x58d606('0x2e')](respondWithResult(_0x4eab2a,null))[_0x58d606('0x3e')](handleError(_0x4eab2a,null));},exports['addIntervals']=function(_0x51641a,_0xaf1296){const _0x937f9e=_0x5d94f3;return db[_0x937f9e('0x1d')]['findOne']({'where':{'id':_0x51641a[_0x937f9e('0xd')]['id']}})[_0x937f9e('0x2e')](handleEntityNotFound(_0xaf1296,null))[_0x937f9e('0x2e')](function(_0x4b5054){const _0x457e6b=_0x937f9e;if(_0x4b5054)return db[_0x457e6b('0x4')][_0x457e6b('0x29')](function(_0x4e03b7){const _0x2ef4e6=_0x457e6b;return db[_0x2ef4e6('0x1d')][_0x2ef4e6('0x2a')]({'where':{'IntervalId':_0x51641a['params']['id']},'transaction':_0x4e03b7})[_0x2ef4e6('0x2e')](function(){const _0x20b396=_0x2ef4e6,_0xdd8317=_[_0x20b396('0x15')](_0x51641a['body'],function(_0x63b184){const _0x24d574=_0x20b396;return delete _0x63b184['id'],_0x63b184[_0x24d574('0x23')]=_0x51641a[_0x24d574('0xd')]['id'],_0x63b184;});return db[_0x20b396('0x1d')][_0x20b396('0x3c')](_0xdd8317,{'transaction':_0x4e03b7});});})[_0x457e6b('0x2e')](function(){const _0x434bdc=_0x457e6b;return db[_0x434bdc('0x1d')]['findAll']({'where':{'IntervalId':_0x51641a[_0x434bdc('0xd')]['id']}});});})[_0x937f9e('0x2e')](respondWithResult(_0xaf1296,null))[_0x937f9e('0x3e')](handleError(_0xaf1296,null));};
\ No newline at end of file
+const a367_0xbe58=['update','get','nolimit','status','Interval','body','send','name','show','addInterval','type','fields','query','merge','count','stack','options','intersection','Unable\x20to\x20retrieve\x20the\x20current\x20user','transaction','findAll','rawAttributes','role','findOne','length','map','json','limit','set','order','bulkCreate','then','attributes','filters','filter','IntervalId','VIRTUAL','error','api','undefined','pick','getIntervals','includeAll','Content-Range','catch','offset','sort','where','create','include','user','sequelize','destroy','model','like','autoAssociation','Intervals','userProfileId','index','keys','lodash','../../config/logger','UserProfileResource','fieldName','params'];(function(_0x9f90b1,_0xbe587b){const _0x160cea=function(_0x3db938){while(--_0x3db938){_0x9f90b1['push'](_0x9f90b1['shift']());}};_0x160cea(++_0xbe587b);}(a367_0xbe58,0x74));const a367_0x160c=function(_0x9f90b1,_0xbe587b){_0x9f90b1=_0x9f90b1-0x0;let _0x160cea=a367_0xbe58[_0x9f90b1];return _0x160cea;};const _0x3f3ba1=a367_0x160c;'use strict';const _=require(_0x3f3ba1('0x9')),qs=require('../../components/parsers/qs'),logger=require(_0x3f3ba1('0xa'))(_0x3f3ba1('0x34')),db=require('../../mysqldb')['db'],{Op}=require('sequelize');function respondWithResult(_0x3db938,_0x10b88b){return _0x10b88b=_0x10b88b||0xc8,function(_0x35c6fc){const _0x1239ce=a367_0x160c;if(_0x35c6fc)return _0x3db938[_0x1239ce('0x11')](_0x10b88b)[_0x1239ce('0x28')](_0x35c6fc);};}function respondWithFilteredResult(_0x480f5d,_0x1e77ce){return function(_0x2115a8){const _0x249f7b=a367_0x160c;if(_0x2115a8){const _0x5a9ff0=_0x2115a8['count'],_0x46abf3=_0x1e77ce[_0x249f7b('0x3b')];let _0x1758a3=_0x1e77ce[_0x249f7b('0x3b')]+_0x1e77ce[_0x249f7b('0x29')],_0x476d58;return _0x1758a3>=_0x5a9ff0?(_0x1758a3=_0x5a9ff0,_0x476d58=0xc8):_0x476d58=0xce,_0x480f5d[_0x249f7b('0x11')](_0x476d58),_0x480f5d[_0x249f7b('0x2a')](_0x249f7b('0x39'),_0x46abf3+'-'+_0x1758a3+'/'+_0x5a9ff0)[_0x249f7b('0x28')](_0x2115a8);}return null;};}function saveUpdates(_0x502ff2){return function(_0x419ddb){const _0x187f58=a367_0x160c;if(_0x419ddb)return _0x419ddb['update'](_0x502ff2)[_0x187f58('0x2d')](function(_0x5bd557){return _0x5bd557;});return null;};}function removeEntity(_0x5143b9){return function(_0x96f591){const _0x16ee6a=a367_0x160c;if(_0x96f591)return _0x96f591[_0x16ee6a('0x1')]()[_0x16ee6a('0x2d')](function(){const _0x30b1ab=_0x16ee6a,_0x37e172=_0x96f591['get']({'plain':!![]}),_0x447658=_0x30b1ab('0x5');return db[_0x30b1ab('0xb')]['destroy']({'where':{'type':_0x447658,'resourceId':_0x37e172['id']}})[_0x30b1ab('0x2d')](function(){return _0x96f591;});})[_0x16ee6a('0x2d')](function(){const _0x4de4a3=_0x16ee6a;_0x5143b9[_0x4de4a3('0x11')](0xcc)['end']();});};}function handleEntityNotFound(_0x5336a9){return function(_0x275acc){return!_0x275acc&&_0x5336a9['sendStatus'](0x194),_0x275acc;};}function handleError(_0x412219,_0x1020c7){return _0x1020c7=_0x1020c7||0x1f4,function(_0x13126e){const _0x39584c=a367_0x160c;logger[_0x39584c('0x33')](_0x13126e[_0x39584c('0x1d')]),_0x13126e['name']&&delete _0x13126e['name'],_0x412219['status'](_0x1020c7)[_0x39584c('0x14')](_0x13126e);};}exports[_0x3f3ba1('0x7')]=function(_0x2a70e9,_0x49e1ef){const _0x37bfc0=_0x3f3ba1;let _0x3bad5d={};const _0x281ccb={},_0x55e3b4={'count':0x0,'rows':[]},_0x50c37d=_[_0x37bfc0('0x27')](db[_0x37bfc0('0x12')][_0x37bfc0('0x23')],function(_0x36ee3f){const _0x30bd4d=_0x37bfc0;return{'name':_0x36ee3f[_0x30bd4d('0xc')],'type':_0x36ee3f[_0x30bd4d('0x18')]['key']};});_0x281ccb[_0x37bfc0('0x2')]=_[_0x37bfc0('0x27')](_0x50c37d,_0x37bfc0('0x15')),_0x281ccb[_0x37bfc0('0x1a')]=_[_0x37bfc0('0x8')](_0x2a70e9[_0x37bfc0('0x1a')]),_0x281ccb[_0x37bfc0('0x2f')]=_[_0x37bfc0('0x1f')](_0x281ccb[_0x37bfc0('0x2')],_0x281ccb[_0x37bfc0('0x1a')]),_0x3bad5d['attributes']=_[_0x37bfc0('0x1f')](_0x281ccb[_0x37bfc0('0x2')],qs[_0x37bfc0('0x19')](_0x2a70e9[_0x37bfc0('0x1a')]['fields'])),_0x3bad5d['attributes']=_0x3bad5d[_0x37bfc0('0x2e')][_0x37bfc0('0x26')]?_0x3bad5d[_0x37bfc0('0x2e')]:_0x281ccb[_0x37bfc0('0x2')];typeof _0x2a70e9[_0x37bfc0('0x1a')][_0x37bfc0('0x10')]==='undefined'&&(_0x3bad5d['limit']=qs[_0x37bfc0('0x29')](_0x2a70e9['query'][_0x37bfc0('0x29')]),_0x3bad5d['offset']=qs[_0x37bfc0('0x3b')](_0x2a70e9[_0x37bfc0('0x1a')][_0x37bfc0('0x3b')]));_0x3bad5d[_0x37bfc0('0x2b')]=qs[_0x37bfc0('0x3c')](_0x2a70e9['query'][_0x37bfc0('0x3c')]),_0x3bad5d['where']=qs['filters'](_[_0x37bfc0('0x36')](_0x2a70e9[_0x37bfc0('0x1a')],_0x281ccb[_0x37bfc0('0x2f')]),_0x50c37d);_0x2a70e9['query'][_0x37bfc0('0x30')]&&(_0x3bad5d[_0x37bfc0('0x3d')]=_[_0x37bfc0('0x1b')](_0x3bad5d[_0x37bfc0('0x3d')],{[Op['or']]:_[_0x37bfc0('0x27')](_0x50c37d,function(_0x5d1ce3){const _0x4f0cf5=_0x37bfc0;if(_0x5d1ce3['type']!==_0x4f0cf5('0x32')){const _0x212e5f={};return _0x212e5f[_0x5d1ce3[_0x4f0cf5('0x15')]]={[Op[_0x4f0cf5('0x3')]]:'%'+_0x2a70e9[_0x4f0cf5('0x1a')][_0x4f0cf5('0x30')]+'%'},_0x212e5f;}})}));_0x3bad5d=_[_0x37bfc0('0x1b')]({},_0x3bad5d,_0x2a70e9['options']);const _0xe37016={'where':_0x3bad5d[_0x37bfc0('0x3d')]};return db[_0x37bfc0('0x12')][_0x37bfc0('0x1c')](_0xe37016)[_0x37bfc0('0x2d')](function(_0x21b0c1){const _0x35a52b=_0x37bfc0;return _0x55e3b4[_0x35a52b('0x1c')]=_0x21b0c1,_0x2a70e9[_0x35a52b('0x1a')]['includeAll']&&(_0x3bad5d['include']=[{'all':!![]}]),db[_0x35a52b('0x12')][_0x35a52b('0x22')](_0x3bad5d);})[_0x37bfc0('0x2d')](function(_0x32fc18){return _0x55e3b4['rows']=_0x32fc18,_0x55e3b4;})[_0x37bfc0('0x2d')](respondWithFilteredResult(_0x49e1ef,_0x3bad5d))[_0x37bfc0('0x3a')](handleError(_0x49e1ef,null));},exports[_0x3f3ba1('0x16')]=function(_0x10f848,_0x536465){const _0x1bba67=_0x3f3ba1;let _0x59454e={'raw':!![],'where':{'id':_0x10f848[_0x1bba67('0xd')]['id']}};const _0x13cde0={};return _0x13cde0[_0x1bba67('0x2')]=_[_0x1bba67('0x8')](db['Interval'][_0x1bba67('0x23')]),_0x13cde0[_0x1bba67('0x1a')]=_['keys'](_0x10f848[_0x1bba67('0x1a')]),_0x13cde0['filters']=_[_0x1bba67('0x1f')](_0x13cde0[_0x1bba67('0x2')],_0x13cde0['query']),_0x59454e[_0x1bba67('0x2e')]=_[_0x1bba67('0x1f')](_0x13cde0[_0x1bba67('0x2')],qs[_0x1bba67('0x19')](_0x10f848[_0x1bba67('0x1a')][_0x1bba67('0x19')])),_0x59454e['attributes']=_0x59454e[_0x1bba67('0x2e')][_0x1bba67('0x26')]?_0x59454e[_0x1bba67('0x2e')]:_0x13cde0['model'],_0x10f848[_0x1bba67('0x1a')][_0x1bba67('0x38')]&&(_0x59454e[_0x1bba67('0x3f')]=[{'all':!![]}]),_0x59454e=_[_0x1bba67('0x1b')]({},_0x59454e,_0x10f848[_0x1bba67('0x1e')]),db[_0x1bba67('0x12')]['findOne'](_0x59454e)['then'](handleEntityNotFound(_0x536465,null))[_0x1bba67('0x2d')](respondWithResult(_0x536465,null))['catch'](handleError(_0x536465,null));},exports['create']=function(_0x11c906,_0x1e6c64){const _0x174d07=_0x3f3ba1;return db[_0x174d07('0x12')]['create'](_0x11c906[_0x174d07('0x13')],{})['then'](function(_0x1536f3){const _0x1b3a28=_0x174d07,_0x224c9a=_0x11c906[_0x1b3a28('0x40')]['get']({'plain':!![]});if(!_0x224c9a)throw new Error(_0x1b3a28('0x20'));if(_0x224c9a[_0x1b3a28('0x24')]===_0x1b3a28('0x40')){const _0x3db9ba=_0x1536f3[_0x1b3a28('0xf')]({'plain':!![]}),_0x4de60d=_0x1b3a28('0x5');return db['UserProfileSection'][_0x1b3a28('0x25')]({'where':{'name':_0x4de60d,'userProfileId':_0x224c9a[_0x1b3a28('0x6')]},'raw':!![]})[_0x1b3a28('0x2d')](function(_0x5b9672){const _0x5f1c08=_0x1b3a28;return _0x5b9672&&_0x5b9672[_0x5f1c08('0x4')]===0x0?db[_0x5f1c08('0xb')][_0x5f1c08('0x3e')]({'name':_0x3db9ba[_0x5f1c08('0x15')],'resourceId':_0x3db9ba['id'],'type':_0x5b9672[_0x5f1c08('0x15')],'sectionId':_0x5b9672['id']},{})[_0x5f1c08('0x2d')](function(){return _0x1536f3;}):_0x1536f3;})['catch'](function(_0x2780ae){const _0x572159=_0x1b3a28;logger[_0x572159('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2780ae);throw _0x2780ae;});}return _0x1536f3;})['then'](respondWithResult(_0x1e6c64,0xc9))[_0x174d07('0x3a')](handleError(_0x1e6c64,null));},exports[_0x3f3ba1('0xe')]=function(_0x11a89f,_0x5dcef4){const _0x1084ea=_0x3f3ba1;return _0x11a89f[_0x1084ea('0x13')]['id']&&delete _0x11a89f[_0x1084ea('0x13')]['id'],db[_0x1084ea('0x12')][_0x1084ea('0x25')]({'where':{'id':_0x11a89f['params']['id']}})[_0x1084ea('0x2d')](handleEntityNotFound(_0x5dcef4,null))['then'](saveUpdates(_0x11a89f['body'],null))[_0x1084ea('0x2d')](respondWithResult(_0x5dcef4,null))['catch'](handleError(_0x5dcef4,null));},exports['destroy']=function(_0x581262,_0x5101c1){const _0x2e3c19=_0x3f3ba1;return db[_0x2e3c19('0x12')][_0x2e3c19('0x25')]({'where':{'id':_0x581262[_0x2e3c19('0xd')]['id']}})[_0x2e3c19('0x2d')](handleEntityNotFound(_0x5101c1,null))[_0x2e3c19('0x2d')](removeEntity(_0x5101c1,null))[_0x2e3c19('0x3a')](handleError(_0x5101c1,null));},exports[_0x3f3ba1('0x17')]=function(_0x1216fa,_0x17527f){const _0xd87c27=_0x3f3ba1;return _0x1216fa['body']['id']&&delete _0x1216fa['body']['id'],db[_0xd87c27('0x12')]['findOne']({'where':{'id':_0x1216fa[_0xd87c27('0xd')]['id']}})[_0xd87c27('0x2d')](handleEntityNotFound(_0x17527f,null))[_0xd87c27('0x2d')](function(_0x2be241){const _0x3f6e05=_0xd87c27;if(_0x2be241)return _0x1216fa[_0x3f6e05('0x13')][_0x3f6e05('0x31')]=_0x2be241['id'],db[_0x3f6e05('0x12')][_0x3f6e05('0x3e')](_0x1216fa[_0x3f6e05('0x13')]);})[_0xd87c27('0x2d')](respondWithResult(_0x17527f,null))['catch'](handleError(_0x17527f,null));},exports['getIntervals']=function(_0x59a9fd,_0x467bc2){const _0x96bdd5=_0x3f3ba1;let _0x336d18={};const _0x13f3bf={};let _0x5266b7,_0x35426c;return db[_0x96bdd5('0x12')][_0x96bdd5('0x25')]({'where':{'id':_0x59a9fd['params']['id']}})[_0x96bdd5('0x2d')](handleEntityNotFound(_0x467bc2,null))['then'](function(_0x5a9219){const _0xbd603f=_0x96bdd5;if(_0x5a9219)return _0x5266b7=_0x5a9219,_0x13f3bf['model']=_[_0xbd603f('0x8')](db[_0xbd603f('0x12')][_0xbd603f('0x23')]),_0x13f3bf['query']=_[_0xbd603f('0x8')](_0x59a9fd['query']),_0x13f3bf['filters']=_[_0xbd603f('0x1f')](_0x13f3bf[_0xbd603f('0x2')],_0x13f3bf['query']),_0x336d18[_0xbd603f('0x2e')]=_['intersection'](_0x13f3bf[_0xbd603f('0x2')],qs['fields'](_0x59a9fd[_0xbd603f('0x1a')][_0xbd603f('0x19')])),_0x336d18[_0xbd603f('0x2e')]=_0x336d18[_0xbd603f('0x2e')][_0xbd603f('0x26')]?_0x336d18['attributes']:_0x13f3bf[_0xbd603f('0x2')],_0x336d18[_0xbd603f('0x2b')]=qs[_0xbd603f('0x3c')](_0x59a9fd[_0xbd603f('0x1a')]['sort']),_0x336d18['where']=qs[_0xbd603f('0x2f')](_[_0xbd603f('0x36')](_0x59a9fd[_0xbd603f('0x1a')],_0x13f3bf[_0xbd603f('0x2f')])),_0x59a9fd[_0xbd603f('0x1a')]['filter']&&(_0x336d18[_0xbd603f('0x3d')]=_[_0xbd603f('0x1b')](_0x336d18['where'],{[Op['or']]:_[_0xbd603f('0x27')](_0x336d18['attributes'],function(_0x184ba3){const _0x446cb5=_0xbd603f,_0x225e92={};return _0x225e92[_0x184ba3]={[Op['like']]:'%'+_0x59a9fd[_0x446cb5('0x1a')][_0x446cb5('0x30')]+'%'},_0x225e92;})})),_0x336d18=_[_0xbd603f('0x1b')]({},_0x336d18,_0x59a9fd['options']),_0x5266b7[_0xbd603f('0x37')](_0x336d18);})['then'](function(_0x349cfa){const _0xc372f6=_0x96bdd5;if(_0x349cfa)return _0x35426c=_0x349cfa[_0xc372f6('0x26')],typeof _0x59a9fd[_0xc372f6('0x1a')][_0xc372f6('0x10')]===_0xc372f6('0x35')&&(_0x336d18[_0xc372f6('0x29')]=qs[_0xc372f6('0x29')](_0x59a9fd[_0xc372f6('0x1a')][_0xc372f6('0x29')]),_0x336d18[_0xc372f6('0x3b')]=qs['offset'](_0x59a9fd[_0xc372f6('0x1a')][_0xc372f6('0x3b')])),_0x5266b7[_0xc372f6('0x37')](_0x336d18);})['then'](function(_0x5084a6){if(_0x5084a6)return _0x5084a6?{'count':_0x35426c,'rows':_0x5084a6}:null;})[_0x96bdd5('0x2d')](respondWithResult(_0x467bc2,null))[_0x96bdd5('0x3a')](handleError(_0x467bc2,null));},exports['addIntervals']=function(_0x55a281,_0x2eb0f9){const _0x28ea62=_0x3f3ba1;return db[_0x28ea62('0x12')][_0x28ea62('0x25')]({'where':{'id':_0x55a281['params']['id']}})[_0x28ea62('0x2d')](handleEntityNotFound(_0x2eb0f9,null))['then'](function(_0x33f923){const _0x45c4bf=_0x28ea62;if(_0x33f923)return db[_0x45c4bf('0x0')][_0x45c4bf('0x21')](function(_0x58ee07){const _0x57ac92=_0x45c4bf;return db[_0x57ac92('0x12')][_0x57ac92('0x1')]({'where':{'IntervalId':_0x55a281[_0x57ac92('0xd')]['id']},'transaction':_0x58ee07})[_0x57ac92('0x2d')](function(){const _0x34c81d=_0x57ac92,_0x4c9442=_[_0x34c81d('0x27')](_0x55a281['body'],function(_0x1a62ff){const _0x1a1aa8=_0x34c81d;return delete _0x1a62ff['id'],_0x1a62ff[_0x1a1aa8('0x31')]=_0x55a281[_0x1a1aa8('0xd')]['id'],_0x1a62ff;});return db[_0x34c81d('0x12')][_0x34c81d('0x2c')](_0x4c9442,{'transaction':_0x58ee07});});})['then'](function(){const _0x474261=_0x45c4bf;return db['Interval'][_0x474261('0x22')]({'where':{'IntervalId':_0x55a281[_0x474261('0xd')]['id']}});});})[_0x28ea62('0x2d')](respondWithResult(_0x2eb0f9,null))[_0x28ea62('0x3a')](handleError(_0x2eb0f9,null));};
\ No newline at end of file