Built motion from commit 129fb4d95212661e48f0db455e75d668addbaddf. Version 3.0.0...
[motion-next.git] / server / api / chatProactiveAction / chatProactiveAction.controller.js
index dbbb31f..4135c0a 100644 (file)
@@ -1 +1 @@
-const a91_0x2281=['body','sendStatus','stack','../../mysqldb','keys','model','fields','send','error','ChatProactiveAction','attributes','update','api','status','create','end','then','filters','destroy','json','rawAttributes','params','lodash','query','name','../../components/parsers/qs','findOne','catch','length','intersection'];(function(_0x58f2d9,_0x22819a){const _0x2fcb4a=function(_0x34423b){while(--_0x34423b){_0x58f2d9['push'](_0x58f2d9['shift']());}};_0x2fcb4a(++_0x22819a);}(a91_0x2281,0x15b));const a91_0x2fcb=function(_0x58f2d9,_0x22819a){_0x58f2d9=_0x58f2d9-0x0;let _0x2fcb4a=a91_0x2281[_0x58f2d9];return _0x2fcb4a;};const _0x515440=a91_0x2fcb;'use strict';const _=require(_0x515440('0x5')),qs=require(_0x515440('0x8')),logger=require('../../config/logger')(_0x515440('0x19')),db=require(_0x515440('0x10'))['db'];function respondWithResult(_0x34423b,_0x5637d9){return _0x5637d9=_0x5637d9||0xc8,function(_0x5f2612){const _0x23d0d1=a91_0x2fcb;if(_0x5f2612)return _0x34423b[_0x23d0d1('0x1a')](_0x5637d9)[_0x23d0d1('0x2')](_0x5f2612);};}function saveUpdates(_0x326e22){return function(_0xf84254){const _0x22ab1e=a91_0x2fcb;if(_0xf84254)return _0xf84254[_0x22ab1e('0x18')](_0x326e22)[_0x22ab1e('0x1d')](function(_0x1356b5){return _0x1356b5;});return null;};}function removeEntity(_0x45ecc1){return function(_0xb681c6){const _0x5dcebb=a91_0x2fcb;if(_0xb681c6)return _0xb681c6['destroy']()[_0x5dcebb('0x1d')](function(){const _0x3b5bcc=_0x5dcebb;_0x45ecc1[_0x3b5bcc('0x1a')](0xcc)[_0x3b5bcc('0x1c')]();});};}function handleEntityNotFound(_0x1a27ef){return function(_0x5f47c4){const _0x10357d=a91_0x2fcb;return!_0x5f47c4&&_0x1a27ef[_0x10357d('0xe')](0x194),_0x5f47c4;};}function handleError(_0x888011,_0x5a82c9){return _0x5a82c9=_0x5a82c9||0x1f4,function(_0x3a562f){const _0x20beff=a91_0x2fcb;logger[_0x20beff('0x15')](_0x3a562f[_0x20beff('0xf')]),_0x3a562f[_0x20beff('0x7')]&&delete _0x3a562f[_0x20beff('0x7')],_0x888011['status'](_0x5a82c9)[_0x20beff('0x14')](_0x3a562f);};}exports['show']=function(_0x41791f,_0x90546a){const _0x5e2a59=_0x515440;let _0xb19235={'raw':!![],'where':{'id':_0x41791f[_0x5e2a59('0x4')]['id']}};const _0x5b2dbd={};return _0x5b2dbd[_0x5e2a59('0x12')]=_[_0x5e2a59('0x11')](db[_0x5e2a59('0x16')][_0x5e2a59('0x3')]),_0x5b2dbd[_0x5e2a59('0x6')]=_[_0x5e2a59('0x11')](_0x41791f[_0x5e2a59('0x6')]),_0x5b2dbd[_0x5e2a59('0x0')]=_[_0x5e2a59('0xc')](_0x5b2dbd[_0x5e2a59('0x12')],_0x5b2dbd['query']),_0xb19235[_0x5e2a59('0x17')]=_['intersection'](_0x5b2dbd[_0x5e2a59('0x12')],qs[_0x5e2a59('0x13')](_0x41791f['query'][_0x5e2a59('0x13')])),_0xb19235[_0x5e2a59('0x17')]=_0xb19235[_0x5e2a59('0x17')][_0x5e2a59('0xb')]?_0xb19235[_0x5e2a59('0x17')]:_0x5b2dbd[_0x5e2a59('0x12')],_0x41791f[_0x5e2a59('0x6')]['includeAll']&&(_0xb19235['include']=[{'all':!![]}]),_0xb19235=_['merge']({},_0xb19235,_0x41791f['options']),db['ChatProactiveAction'][_0x5e2a59('0x9')](_0xb19235)['then'](handleEntityNotFound(_0x90546a,null))[_0x5e2a59('0x1d')](respondWithResult(_0x90546a,null))['catch'](handleError(_0x90546a,null));},exports[_0x515440('0x1b')]=function(_0x235d97,_0x592374){const _0xbd4a4e=_0x515440;return db[_0xbd4a4e('0x16')]['create'](_0x235d97[_0xbd4a4e('0xd')],{})[_0xbd4a4e('0x1d')](respondWithResult(_0x592374,0xc9))[_0xbd4a4e('0xa')](handleError(_0x592374,null));},exports[_0x515440('0x18')]=function(_0x12096d,_0x5dbf36){const _0x23d71c=_0x515440;return _0x12096d['body']['id']&&delete _0x12096d[_0x23d71c('0xd')]['id'],db[_0x23d71c('0x16')][_0x23d71c('0x9')]({'where':{'id':_0x12096d[_0x23d71c('0x4')]['id']}})['then'](handleEntityNotFound(_0x5dbf36,null))[_0x23d71c('0x1d')](saveUpdates(_0x12096d[_0x23d71c('0xd')],null))[_0x23d71c('0x1d')](respondWithResult(_0x5dbf36,null))['catch'](handleError(_0x5dbf36,null));},exports[_0x515440('0x1')]=function(_0x4d6b76,_0x2428eb){const _0x1471d9=_0x515440;return db['ChatProactiveAction']['findOne']({'where':{'id':_0x4d6b76[_0x1471d9('0x4')]['id']}})[_0x1471d9('0x1d')](handleEntityNotFound(_0x2428eb,null))[_0x1471d9('0x1d')](removeEntity(_0x2428eb,null))[_0x1471d9('0xa')](handleError(_0x2428eb,null));};
\ No newline at end of file
+const a109_0x502f=['length','filters','model','findOne','api','end','../../components/parsers/qs','intersection','includeAll','../../mysqldb','merge','update','show','sendStatus','catch','destroy','include','error','name','rawAttributes','attributes','stack','then','keys','ChatProactiveAction','params','body','status','fields','query','lodash','json'];(function(_0x234a4d,_0x38c142){const _0x502f79=function(_0x396d80){while(--_0x396d80){_0x234a4d['push'](_0x234a4d['shift']());}};_0x502f79(++_0x38c142);}(a109_0x502f,0x94));const a109_0x396d=function(_0x234a4d,_0x38c142){_0x234a4d=_0x234a4d-0x19e;let _0x502f79=a109_0x502f[_0x234a4d];return _0x502f79;};const a109_0x19bbe1=a109_0x396d;'use strict';const _=require(a109_0x19bbe1(0x1a8)),qs=require(a109_0x19bbe1(0x1b0)),logger=require('../../config/logger')(a109_0x19bbe1(0x1ae)),{db}=require(a109_0x19bbe1(0x1b3));function respondWithResult(_0x178806,_0x16da5a){return _0x16da5a=_0x16da5a||0xc8,function(_0x331146){const _0x1ff3d6=a109_0x396d;if(_0x331146)return _0x178806[_0x1ff3d6(0x1a5)](_0x16da5a)[_0x1ff3d6(0x1a9)](_0x331146);};}function saveUpdates(_0xd4f09e){return function(_0x2007d2){const _0x3a7ea5=a109_0x396d;if(_0x2007d2)return _0x2007d2[_0x3a7ea5(0x1b5)](_0xd4f09e)['then'](function(_0xf2fbe3){return _0xf2fbe3;});return null;};}function removeEntity(_0x22db5d){return function(_0x4a6daf){const _0x10c746=a109_0x396d;if(_0x4a6daf)return _0x4a6daf[_0x10c746(0x1b9)]()[_0x10c746(0x1a0)](function(){const _0x1b1801=_0x10c746;_0x22db5d[_0x1b1801(0x1a5)](0xcc)[_0x1b1801(0x1af)]();});};}function handleEntityNotFound(_0x3c5ca2){return function(_0x2e7d25){const _0x3af9fe=a109_0x396d;return!_0x2e7d25&&_0x3c5ca2[_0x3af9fe(0x1b7)](0x194),_0x2e7d25;};}function handleError(_0x2acc28,_0x50c686){return _0x50c686=_0x50c686||0x1f4,function(_0x3580e8){const _0x35c346=a109_0x396d;logger[_0x35c346(0x1bb)](_0x3580e8[_0x35c346(0x19f)]),_0x3580e8['name']&&delete _0x3580e8[_0x35c346(0x1bc)],_0x2acc28[_0x35c346(0x1a5)](_0x50c686)['send'](_0x3580e8);};}exports[a109_0x19bbe1(0x1b6)]=function(_0x69b5e1,_0x45ead0){const _0x12ca68=a109_0x19bbe1;let _0x2c114b={'raw':!![],'where':{'id':_0x69b5e1[_0x12ca68(0x1a3)]['id']}};const _0x20be8d={};return _0x20be8d[_0x12ca68(0x1ac)]=_[_0x12ca68(0x1a1)](db[_0x12ca68(0x1a2)][_0x12ca68(0x1bd)]),_0x20be8d[_0x12ca68(0x1a7)]=_[_0x12ca68(0x1a1)](_0x69b5e1[_0x12ca68(0x1a7)]),_0x20be8d[_0x12ca68(0x1ab)]=_[_0x12ca68(0x1b1)](_0x20be8d[_0x12ca68(0x1ac)],_0x20be8d['query']),_0x2c114b[_0x12ca68(0x19e)]=_[_0x12ca68(0x1b1)](_0x20be8d[_0x12ca68(0x1ac)],qs[_0x12ca68(0x1a6)](_0x69b5e1[_0x12ca68(0x1a7)]['fields'])),_0x2c114b[_0x12ca68(0x19e)]=_0x2c114b[_0x12ca68(0x19e)][_0x12ca68(0x1aa)]?_0x2c114b[_0x12ca68(0x19e)]:_0x20be8d[_0x12ca68(0x1ac)],_0x69b5e1[_0x12ca68(0x1a7)][_0x12ca68(0x1b2)]&&(_0x2c114b[_0x12ca68(0x1ba)]=[{'all':!![]}]),_0x2c114b=_[_0x12ca68(0x1b4)]({},_0x2c114b,_0x69b5e1['options']),db[_0x12ca68(0x1a2)]['findOne'](_0x2c114b)[_0x12ca68(0x1a0)](handleEntityNotFound(_0x45ead0,null))[_0x12ca68(0x1a0)](respondWithResult(_0x45ead0,null))[_0x12ca68(0x1b8)](handleError(_0x45ead0,null));},exports['create']=function(_0x3b3382,_0x2d4e21){const _0x2140a0=a109_0x19bbe1;return db[_0x2140a0(0x1a2)]['create'](_0x3b3382['body'],{})[_0x2140a0(0x1a0)](respondWithResult(_0x2d4e21,0xc9))[_0x2140a0(0x1b8)](handleError(_0x2d4e21,null));},exports['update']=function(_0x363ed4,_0x4eb1c6){const _0x4a0968=a109_0x19bbe1;return _0x363ed4[_0x4a0968(0x1a4)]['id']&&delete _0x363ed4[_0x4a0968(0x1a4)]['id'],db[_0x4a0968(0x1a2)]['findOne']({'where':{'id':_0x363ed4[_0x4a0968(0x1a3)]['id']}})[_0x4a0968(0x1a0)](handleEntityNotFound(_0x4eb1c6,null))['then'](saveUpdates(_0x363ed4[_0x4a0968(0x1a4)],null))[_0x4a0968(0x1a0)](respondWithResult(_0x4eb1c6,null))['catch'](handleError(_0x4eb1c6,null));},exports[a109_0x19bbe1(0x1b9)]=function(_0x22a996,_0x130f8c){const _0xfce1e6=a109_0x19bbe1;return db[_0xfce1e6(0x1a2)][_0xfce1e6(0x1ad)]({'where':{'id':_0x22a996['params']['id']}})['then'](handleEntityNotFound(_0x130f8c,null))['then'](removeEntity(_0x130f8c,null))['catch'](handleError(_0x130f8c,null));};
\ No newline at end of file