Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / api / jscriptyQuestionReport / jscriptyQuestionReport.controller.js
index edfef02..8c74966 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f34=['reject','save','update','then','destroy','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','where','filter','merge','options','rows','catch','show','params','includeAll','include','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5f34,0x186));var _0x45f3=function(_0x32e502,_0x15dab3){_0x32e502=_0x32e502-0x0;var _0x1931ac=_0x5f34[_0x32e502];return _0x1931ac;};'use strict';var pdf=require(_0x45f3('0x0'));var emlformat=require(_0x45f3('0x1'));var rimraf=require(_0x45f3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x45f3('0x3'));var rp=require(_0x45f3('0x4'));var moment=require(_0x45f3('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x45f3('0x6'));var sox=require(_0x45f3('0x7'));var csv=require(_0x45f3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x45f3('0x9'));var squel=require(_0x45f3('0xa'));var crypto=require(_0x45f3('0xb'));var jsforce=require(_0x45f3('0xc'));var deskjs=require(_0x45f3('0xd'));var toCsv=require(_0x45f3('0x8'));var querystring=require(_0x45f3('0xe'));var Papa=require(_0x45f3('0xf'));var Redis=require(_0x45f3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x45f3('0x11'));var as=require(_0x45f3('0x12'));var hardwareService=require(_0x45f3('0x13'));var logger=require('../../config/logger')(_0x45f3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x45f3('0x15'))['db'];function respondWithStatusCode(_0x511e8c,_0x24c4ab){_0x24c4ab=_0x24c4ab||0xcc;return function(_0x11b452){if(_0x11b452){return _0x511e8c['sendStatus'](_0x24c4ab);}return _0x511e8c[_0x45f3('0x16')](_0x24c4ab)[_0x45f3('0x17')]();};}function respondWithResult(_0x1f51c5,_0x419be9){_0x419be9=_0x419be9||0xc8;return function(_0x171368){if(_0x171368){return _0x1f51c5['status'](_0x419be9)[_0x45f3('0x18')](_0x171368);}};}function respondWithFilteredResult(_0x46c83f,_0x5db739){return function(_0x171b14){if(_0x171b14){var _0x425367=_0x171b14[_0x45f3('0x19')],_0xaa28ec=_0x5db739[_0x45f3('0x1a')],_0x55e489=_0x5db739[_0x45f3('0x1a')]+_0x5db739[_0x45f3('0x1b')],_0x30ed51;if(_0x55e489>=_0x425367){_0x55e489=_0x425367;_0x30ed51=0xc8;}else{_0x30ed51=0xce;}_0x46c83f[_0x45f3('0x16')](_0x30ed51);return _0x46c83f[_0x45f3('0x1c')](_0x45f3('0x1d'),_0xaa28ec+'-'+_0x55e489+'/'+_0x425367)[_0x45f3('0x18')](_0x171b14);}return null;};}function patchUpdates(_0x107233){return function(_0x22b03f){try{jsonpatch['apply'](_0x22b03f,_0x107233,!![]);}catch(_0x557c9e){return BPromise[_0x45f3('0x1e')](_0x557c9e);}return _0x22b03f[_0x45f3('0x1f')]();};}function saveUpdates(_0xcef970,_0x4f923b){return function(_0x8da55a){if(_0x8da55a){return _0x8da55a[_0x45f3('0x20')](_0xcef970)[_0x45f3('0x21')](function(_0x661dc5){return _0x661dc5;});}return null;};}function removeEntity(_0x22fd7a,_0xd67e77){return function(_0x4a23a1){if(_0x4a23a1){return _0x4a23a1[_0x45f3('0x22')]()[_0x45f3('0x21')](function(){_0x22fd7a[_0x45f3('0x16')](0xcc)[_0x45f3('0x17')]();});}};}function handleEntityNotFound(_0x2e2f21,_0x28e8e4){return function(_0x22f1cb){if(!_0x22f1cb){_0x2e2f21['sendStatus'](0x194);}return _0x22f1cb;};}function handleError(_0x2518ee,_0x20da24){_0x20da24=_0x20da24||0x1f4;return function(_0x1628e1){logger[_0x45f3('0x23')](_0x1628e1['stack']);if(_0x1628e1[_0x45f3('0x24')]){delete _0x1628e1[_0x45f3('0x24')];}_0x2518ee['status'](_0x20da24)[_0x45f3('0x25')](_0x1628e1);};}exports[_0x45f3('0x26')]=function(_0x3f63b2,_0x47e06){var _0x13787a={},_0x186768={},_0x9f4406={'count':0x0,'rows':[]};var _0x21d54c=_[_0x45f3('0x27')](db[_0x45f3('0x28')][_0x45f3('0x29')],function(_0x5cad81){return{'name':_0x5cad81[_0x45f3('0x2a')],'type':_0x5cad81[_0x45f3('0x2b')][_0x45f3('0x2c')]};});_0x186768[_0x45f3('0x2d')]=_[_0x45f3('0x27')](_0x21d54c,_0x45f3('0x24'));_0x186768[_0x45f3('0x2e')]=_[_0x45f3('0x2f')](_0x3f63b2['query']);_0x186768[_0x45f3('0x30')]=_['intersection'](_0x186768[_0x45f3('0x2d')],_0x186768[_0x45f3('0x2e')]);_0x13787a['attributes']=_[_0x45f3('0x31')](_0x186768[_0x45f3('0x2d')],qs[_0x45f3('0x32')](_0x3f63b2[_0x45f3('0x2e')][_0x45f3('0x32')]));_0x13787a[_0x45f3('0x33')]=_0x13787a['attributes'][_0x45f3('0x34')]?_0x13787a[_0x45f3('0x33')]:_0x186768['model'];if(!_0x3f63b2[_0x45f3('0x2e')][_0x45f3('0x35')]('nolimit')){_0x13787a['limit']=qs[_0x45f3('0x1b')](_0x3f63b2[_0x45f3('0x2e')][_0x45f3('0x1b')]);_0x13787a[_0x45f3('0x1a')]=qs['offset'](_0x3f63b2[_0x45f3('0x2e')][_0x45f3('0x1a')]);}_0x13787a[_0x45f3('0x36')]=qs['sort'](_0x3f63b2[_0x45f3('0x2e')]['sort']);_0x13787a['where']=qs[_0x45f3('0x30')](_[_0x45f3('0x37')](_0x3f63b2[_0x45f3('0x2e')],_0x186768['filters']));if(_0x3f63b2[_0x45f3('0x2e')]['filter']){_0x13787a[_0x45f3('0x38')]=_['merge'](_0x13787a['where'],{'$or':_[_0x45f3('0x27')](_0x21d54c,function(_0x2b1e1c){if(_0x2b1e1c[_0x45f3('0x2b')]!=='VIRTUAL'){var _0x323581={};_0x323581[_0x2b1e1c[_0x45f3('0x24')]]={'$like':'%'+_0x3f63b2[_0x45f3('0x2e')][_0x45f3('0x39')]+'%'};return _0x323581;}})});}_0x13787a=_[_0x45f3('0x3a')]({},_0x13787a,_0x3f63b2[_0x45f3('0x3b')]);var _0x554228={'where':_0x13787a['where']};return db['JscriptyQuestionReport'][_0x45f3('0x19')](_0x554228)[_0x45f3('0x21')](function(_0x459fc4){_0x9f4406[_0x45f3('0x19')]=_0x459fc4;if(_0x3f63b2[_0x45f3('0x2e')]['includeAll']){_0x13787a['include']=[{'all':!![]}];}return db[_0x45f3('0x28')]['findAll'](_0x13787a);})[_0x45f3('0x21')](function(_0x45a33e){_0x9f4406[_0x45f3('0x3c')]=_0x45a33e;return _0x9f4406;})[_0x45f3('0x21')](respondWithFilteredResult(_0x47e06,_0x13787a))[_0x45f3('0x3d')](handleError(_0x47e06,null));};exports[_0x45f3('0x3e')]=function(_0x75400a,_0x457f61){var _0x49647b={'raw':!![],'where':{'id':_0x75400a[_0x45f3('0x3f')]['id']}},_0x4733c5={};_0x4733c5['model']=_[_0x45f3('0x2f')](db[_0x45f3('0x28')][_0x45f3('0x29')]);_0x4733c5['query']=_[_0x45f3('0x2f')](_0x75400a[_0x45f3('0x2e')]);_0x4733c5[_0x45f3('0x30')]=_['intersection'](_0x4733c5[_0x45f3('0x2d')],_0x4733c5['query']);_0x49647b[_0x45f3('0x33')]=_[_0x45f3('0x31')](_0x4733c5[_0x45f3('0x2d')],qs[_0x45f3('0x32')](_0x75400a['query'][_0x45f3('0x32')]));_0x49647b['attributes']=_0x49647b[_0x45f3('0x33')][_0x45f3('0x34')]?_0x49647b[_0x45f3('0x33')]:_0x4733c5[_0x45f3('0x2d')];if(_0x75400a[_0x45f3('0x2e')][_0x45f3('0x40')]){_0x49647b[_0x45f3('0x41')]=[{'all':!![]}];}_0x49647b=_['merge']({},_0x49647b,_0x75400a[_0x45f3('0x3b')]);return db[_0x45f3('0x28')][_0x45f3('0x42')](_0x49647b)['then'](handleEntityNotFound(_0x457f61,null))['then'](respondWithResult(_0x457f61,null))[_0x45f3('0x3d')](handleError(_0x457f61,null));};exports[_0x45f3('0x43')]=function(_0x1020ec,_0x4676df){return db[_0x45f3('0x28')]['create'](_0x1020ec['body'],{})[_0x45f3('0x21')](respondWithResult(_0x4676df,0xc9))[_0x45f3('0x3d')](handleError(_0x4676df,null));};exports[_0x45f3('0x20')]=function(_0x556014,_0xfaf247){if(_0x556014[_0x45f3('0x44')]['id']){delete _0x556014[_0x45f3('0x44')]['id'];}return db[_0x45f3('0x28')][_0x45f3('0x42')]({'where':{'id':_0x556014[_0x45f3('0x3f')]['id']}})[_0x45f3('0x21')](handleEntityNotFound(_0xfaf247,null))[_0x45f3('0x21')](saveUpdates(_0x556014['body'],null))[_0x45f3('0x21')](respondWithResult(_0xfaf247,null))[_0x45f3('0x3d')](handleError(_0xfaf247,null));};exports[_0x45f3('0x22')]=function(_0x593ba3,_0x301696){return db[_0x45f3('0x28')]['find']({'where':{'id':_0x593ba3['params']['id']}})[_0x45f3('0x21')](handleEntityNotFound(_0x301696,null))[_0x45f3('0x21')](removeEntity(_0x301696,null))[_0x45f3('0x3d')](handleError(_0x301696,null));};exports['describe']=function(_0x530cc1,_0x5c5d6e){return db[_0x45f3('0x28')][_0x45f3('0x45')]()[_0x45f3('0x21')](respondWithResult(_0x5c5d6e,null))[_0x45f3('0x3d')](handleError(_0x5c5d6e,null));};
\ No newline at end of file
+var _0x91a7=['options','findAll','rows','catch','rawAttributes','includeAll','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','merge','where','VIRTUAL'];(function(_0x5d425c,_0x1acb5c){var _0x4b01c3=function(_0x18388b){while(--_0x18388b){_0x5d425c['push'](_0x5d425c['shift']());}};_0x4b01c3(++_0x1acb5c);}(_0x91a7,0xe7));var _0x791a=function(_0x6816dc,_0x1359f6){_0x6816dc=_0x6816dc-0x0;var _0x183599=_0x91a7[_0x6816dc];return _0x183599;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x53dc41,_0x5daecd){_0x5daecd=_0x5daecd||0xcc;return function(_0xc92016){if(_0xc92016){return _0x53dc41[_0x791a('0x16')](_0x5daecd);}return _0x53dc41['status'](_0x5daecd)[_0x791a('0x17')]();};}function respondWithResult(_0x3a2ec6,_0x5d5b11){_0x5d5b11=_0x5d5b11||0xc8;return function(_0x2887f0){if(_0x2887f0){return _0x3a2ec6[_0x791a('0x18')](_0x5d5b11)[_0x791a('0x19')](_0x2887f0);}};}function respondWithFilteredResult(_0x5cdf2,_0x55e845){return function(_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=typeof _0x55e845[_0x791a('0x1a')]===_0x791a('0x1b')&&typeof _0x55e845['limit']===_0x791a('0x1b');var _0x5bea2e=_0x2ce2e0[_0x791a('0x1c')];var _0x52941d=_0x575d11?0x0:_0x55e845['offset'];var _0x588d00=_0x575d11?_0x2ce2e0[_0x791a('0x1c')]:_0x55e845['offset']+_0x55e845['limit'];var _0x39c60b;if(_0x588d00>=_0x5bea2e){_0x588d00=_0x5bea2e;_0x39c60b=0xc8;}else{_0x39c60b=0xce;}_0x5cdf2[_0x791a('0x18')](_0x39c60b);return _0x5cdf2[_0x791a('0x1d')](_0x791a('0x1e'),_0x52941d+'-'+_0x588d00+'/'+_0x5bea2e)['json'](_0x2ce2e0);}return null;};}function patchUpdates(_0x189c0d){return function(_0xcb5e66){try{jsonpatch[_0x791a('0x1f')](_0xcb5e66,_0x189c0d,!![]);}catch(_0x280f1e){return BPromise['reject'](_0x280f1e);}return _0xcb5e66[_0x791a('0x20')]();};}function saveUpdates(_0x2054c6,_0x25bae5){return function(_0x9e17b5){if(_0x9e17b5){return _0x9e17b5[_0x791a('0x21')](_0x2054c6)[_0x791a('0x22')](function(_0x2241a0){return _0x2241a0;});}return null;};}function removeEntity(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(_0xe8e452){return _0xe8e452[_0x791a('0x23')]()['then'](function(){_0x45a67d[_0x791a('0x18')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x380329,_0x2966b8){return function(_0x4d748a){if(!_0x4d748a){_0x380329[_0x791a('0x16')](0x194);}return _0x4d748a;};}function handleError(_0x2db3f7,_0x51dcca){_0x51dcca=_0x51dcca||0x1f4;return function(_0xdfa84f){logger[_0x791a('0x24')](_0xdfa84f[_0x791a('0x25')]);if(_0xdfa84f['name']){delete _0xdfa84f[_0x791a('0x26')];}_0x2db3f7[_0x791a('0x18')](_0x51dcca)[_0x791a('0x27')](_0xdfa84f);};}exports[_0x791a('0x28')]=function(_0x4f423,_0x1a9c6b){var _0x628816={},_0x889534={},_0x58bbc0={'count':0x0,'rows':[]};var _0xbc3436=_[_0x791a('0x29')](db[_0x791a('0x2a')]['rawAttributes'],function(_0x1cdda9){return{'name':_0x1cdda9['fieldName'],'type':_0x1cdda9[_0x791a('0x2b')][_0x791a('0x2c')]};});_0x889534[_0x791a('0x2d')]=_[_0x791a('0x29')](_0xbc3436,_0x791a('0x26'));_0x889534[_0x791a('0x2e')]=_[_0x791a('0x2f')](_0x4f423['query']);_0x889534[_0x791a('0x30')]=_[_0x791a('0x31')](_0x889534[_0x791a('0x2d')],_0x889534[_0x791a('0x2e')]);_0x628816[_0x791a('0x32')]=_['intersection'](_0x889534[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x4f423[_0x791a('0x2e')][_0x791a('0x33')]));_0x628816[_0x791a('0x32')]=_0x628816['attributes'][_0x791a('0x34')]?_0x628816[_0x791a('0x32')]:_0x889534[_0x791a('0x2d')];if(!_0x4f423[_0x791a('0x2e')][_0x791a('0x35')]('nolimit')){_0x628816[_0x791a('0x36')]=qs['limit'](_0x4f423[_0x791a('0x2e')]['limit']);_0x628816['offset']=qs[_0x791a('0x1a')](_0x4f423[_0x791a('0x2e')][_0x791a('0x1a')]);}_0x628816[_0x791a('0x37')]=qs[_0x791a('0x38')](_0x4f423[_0x791a('0x2e')][_0x791a('0x38')]);_0x628816['where']=qs[_0x791a('0x30')](_['pick'](_0x4f423[_0x791a('0x2e')],_0x889534['filters']),_0xbc3436);if(_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]){_0x628816['where']=_[_0x791a('0x3a')](_0x628816[_0x791a('0x3b')],{'$or':_['map'](_0xbc3436,function(_0x45fbfa){if(_0x45fbfa[_0x791a('0x2b')]!==_0x791a('0x3c')){var _0x23db7d={};_0x23db7d[_0x45fbfa[_0x791a('0x26')]]={'$like':'%'+_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]+'%'};return _0x23db7d;}})});}_0x628816=_[_0x791a('0x3a')]({},_0x628816,_0x4f423[_0x791a('0x3d')]);var _0xeafbb5={'where':_0x628816['where']};return db[_0x791a('0x2a')][_0x791a('0x1c')](_0xeafbb5)[_0x791a('0x22')](function(_0x4efbf6){_0x58bbc0[_0x791a('0x1c')]=_0x4efbf6;if(_0x4f423['query']['includeAll']){_0x628816['include']=[{'all':!![]}];}return db[_0x791a('0x2a')][_0x791a('0x3e')](_0x628816);})['then'](function(_0x415c44){_0x58bbc0[_0x791a('0x3f')]=_0x415c44;return _0x58bbc0;})[_0x791a('0x22')](respondWithFilteredResult(_0x1a9c6b,_0x628816))[_0x791a('0x40')](handleError(_0x1a9c6b,null));};exports['show']=function(_0x483336,_0x57b9ba){var _0x2f0395={'raw':!![],'where':{'id':_0x483336['params']['id']}},_0x216dd3={};_0x216dd3[_0x791a('0x2d')]=_[_0x791a('0x2f')](db[_0x791a('0x2a')][_0x791a('0x41')]);_0x216dd3['query']=_[_0x791a('0x2f')](_0x483336['query']);_0x216dd3[_0x791a('0x30')]=_[_0x791a('0x31')](_0x216dd3[_0x791a('0x2d')],_0x216dd3[_0x791a('0x2e')]);_0x2f0395[_0x791a('0x32')]=_['intersection'](_0x216dd3[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x483336[_0x791a('0x2e')][_0x791a('0x33')]));_0x2f0395[_0x791a('0x32')]=_0x2f0395['attributes'][_0x791a('0x34')]?_0x2f0395[_0x791a('0x32')]:_0x216dd3['model'];if(_0x483336['query'][_0x791a('0x42')]){_0x2f0395[_0x791a('0x43')]=[{'all':!![]}];}_0x2f0395=_[_0x791a('0x3a')]({},_0x2f0395,_0x483336['options']);return db['JscriptyQuestionReport'][_0x791a('0x44')](_0x2f0395)[_0x791a('0x22')](handleEntityNotFound(_0x57b9ba,null))['then'](respondWithResult(_0x57b9ba,null))[_0x791a('0x40')](handleError(_0x57b9ba,null));};exports[_0x791a('0x45')]=function(_0x3eac77,_0x549980){return db['JscriptyQuestionReport'][_0x791a('0x45')](_0x3eac77[_0x791a('0x46')],{})[_0x791a('0x22')](respondWithResult(_0x549980,0xc9))[_0x791a('0x40')](handleError(_0x549980,null));};exports['update']=function(_0x2d7c7d,_0x9f768a){if(_0x2d7c7d[_0x791a('0x46')]['id']){delete _0x2d7c7d[_0x791a('0x46')]['id'];}return db['JscriptyQuestionReport'][_0x791a('0x44')]({'where':{'id':_0x2d7c7d[_0x791a('0x47')]['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x9f768a,null))[_0x791a('0x22')](saveUpdates(_0x2d7c7d[_0x791a('0x46')],null))[_0x791a('0x22')](respondWithResult(_0x9f768a,null))[_0x791a('0x40')](handleError(_0x9f768a,null));};exports['destroy']=function(_0xdcb1b,_0x1fd826){return db['JscriptyQuestionReport'][_0x791a('0x44')]({'where':{'id':_0xdcb1b[_0x791a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fd826,null))[_0x791a('0x22')](removeEntity(_0x1fd826,null))[_0x791a('0x40')](handleError(_0x1fd826,null));};exports[_0x791a('0x48')]=function(_0x2e357c,_0xd5ec90){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0xd5ec90,null))[_0x791a('0x40')](handleError(_0xd5ec90,null));};
\ No newline at end of file