Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index 6c8278f..64bd47c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf18=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','find','catch','body','params','destroy','create','sequelize','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','map','CmCustomField'];(function(_0x34456d,_0x10b1e4){var _0x1a131c=function(_0x23606d){while(--_0x23606d){_0x34456d['push'](_0x34456d['shift']());}};_0x1a131c(++_0x10b1e4);}(_0xbf18,0x1eb));var _0x8bf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf18[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8bf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bf1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8bf1('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bf1('0x3'));var path=require('path');var sox=require(_0x8bf1('0x4'));var csv=require(_0x8bf1('0x5'));var ejs=require(_0x8bf1('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bf1('0x7'));var squel=require('squel');var crypto=require(_0x8bf1('0x8'));var jsforce=require(_0x8bf1('0x9'));var deskjs=require(_0x8bf1('0xa'));var toCsv=require(_0x8bf1('0x5'));var querystring=require(_0x8bf1('0xb'));var Papa=require(_0x8bf1('0xc'));var Redis=require(_0x8bf1('0xd'));var authService=require(_0x8bf1('0xe'));var qs=require(_0x8bf1('0xf'));var as=require(_0x8bf1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bf1('0x11'))(_0x8bf1('0x12'));var utils=require(_0x8bf1('0x13'));var config=require(_0x8bf1('0x14'));var licenseUtil=require(_0x8bf1('0x15'));var db=require(_0x8bf1('0x16'))['db'];function respondWithStatusCode(_0x3b166c,_0x582e51){_0x582e51=_0x582e51||0xcc;return function(_0x434076){if(_0x434076){return _0x3b166c[_0x8bf1('0x17')](_0x582e51);}return _0x3b166c['status'](_0x582e51)['end']();};}function respondWithResult(_0x5563f6,_0x483662){_0x483662=_0x483662||0xc8;return function(_0x30af91){if(_0x30af91){return _0x5563f6[_0x8bf1('0x18')](_0x483662)[_0x8bf1('0x19')](_0x30af91);}};}function respondWithFilteredResult(_0x14ac6a,_0x204605){return function(_0x286819){if(_0x286819){var _0x30409a=typeof _0x204605[_0x8bf1('0x1a')]===_0x8bf1('0x1b')&&typeof _0x204605['limit']===_0x8bf1('0x1b');var _0x42016d=_0x286819[_0x8bf1('0x1c')];var _0x5d912d=_0x30409a?0x0:_0x204605['offset'];var _0x3e2d20=_0x30409a?_0x286819[_0x8bf1('0x1c')]:_0x204605['offset']+_0x204605[_0x8bf1('0x1d')];var _0x5eb6ee;if(_0x3e2d20>=_0x42016d){_0x3e2d20=_0x42016d;_0x5eb6ee=0xc8;}else{_0x5eb6ee=0xce;}_0x14ac6a['status'](_0x5eb6ee);return _0x14ac6a[_0x8bf1('0x1e')](_0x8bf1('0x1f'),_0x5d912d+'-'+_0x3e2d20+'/'+_0x42016d)[_0x8bf1('0x19')](_0x286819);}return null;};}function patchUpdates(_0x93a69e){return function(_0x35b17f){try{jsonpatch[_0x8bf1('0x20')](_0x35b17f,_0x93a69e,!![]);}catch(_0x1f5bff){return BPromise[_0x8bf1('0x21')](_0x1f5bff);}return _0x35b17f[_0x8bf1('0x22')]();};}function saveUpdates(_0x343e03,_0x38bb67){return function(_0x37d9bb){if(_0x37d9bb){return _0x37d9bb[_0x8bf1('0x23')](_0x343e03)[_0x8bf1('0x24')](function(_0x75dba1){return _0x75dba1;});}return null;};}function removeEntity(_0x1e73f7,_0x470f71){return function(_0x4fe4e8){if(_0x4fe4e8){return _0x4fe4e8['destroy']()[_0x8bf1('0x24')](function(){_0x1e73f7[_0x8bf1('0x18')](0xcc)[_0x8bf1('0x25')]();});}};}function handleEntityNotFound(_0x3339b0,_0x5a7dcc){return function(_0x1b076a){if(!_0x1b076a){_0x3339b0[_0x8bf1('0x17')](0x194);}return _0x1b076a;};}function handleError(_0x1f88ac,_0x2b1d3a){_0x2b1d3a=_0x2b1d3a||0x1f4;return function(_0x412039){logger[_0x8bf1('0x26')](_0x412039[_0x8bf1('0x27')]);if(_0x412039['name']){delete _0x412039[_0x8bf1('0x28')];}_0x1f88ac[_0x8bf1('0x18')](_0x2b1d3a)['send'](_0x412039);};}exports['index']=function(_0x22d8ac,_0x3723a4){var _0x1d9f52={},_0x5afc97={},_0x33cf25={'count':0x0,'rows':[]};var _0x52d911=_[_0x8bf1('0x29')](db[_0x8bf1('0x2a')][_0x8bf1('0x2b')],function(_0x212e6e){return{'name':_0x212e6e[_0x8bf1('0x2c')],'type':_0x212e6e[_0x8bf1('0x2d')][_0x8bf1('0x2e')]};});_0x5afc97[_0x8bf1('0x2f')]=_['differenceBy'](_[_0x8bf1('0x29')](_0x52d911,_0x8bf1('0x28')),[_0x8bf1('0x28')]);_0x5afc97[_0x8bf1('0x30')]=_[_0x8bf1('0x31')](_0x22d8ac[_0x8bf1('0x30')]);_0x5afc97[_0x8bf1('0x32')]=_[_0x8bf1('0x33')](_0x5afc97[_0x8bf1('0x2f')],_0x5afc97[_0x8bf1('0x30')]);_0x1d9f52['attributes']=_['intersection'](_0x5afc97[_0x8bf1('0x2f')],qs[_0x8bf1('0x34')](_0x22d8ac[_0x8bf1('0x30')]['fields']));_0x1d9f52['attributes']=_0x1d9f52[_0x8bf1('0x35')][_0x8bf1('0x36')]?_0x1d9f52[_0x8bf1('0x35')]:_0x5afc97['model'];if(!_0x22d8ac[_0x8bf1('0x30')][_0x8bf1('0x37')](_0x8bf1('0x38'))){_0x1d9f52[_0x8bf1('0x1d')]=qs[_0x8bf1('0x1d')](_0x22d8ac[_0x8bf1('0x30')]['limit']);_0x1d9f52[_0x8bf1('0x1a')]=qs[_0x8bf1('0x1a')](_0x22d8ac[_0x8bf1('0x30')][_0x8bf1('0x1a')]);}_0x1d9f52[_0x8bf1('0x39')]=qs[_0x8bf1('0x3a')](_0x22d8ac['query'][_0x8bf1('0x3a')]);_0x1d9f52[_0x8bf1('0x3b')]=qs[_0x8bf1('0x32')](_[_0x8bf1('0x3c')](_0x22d8ac[_0x8bf1('0x30')],_0x5afc97[_0x8bf1('0x32')]),_0x52d911);if(_0x22d8ac[_0x8bf1('0x30')][_0x8bf1('0x3d')]){_0x1d9f52[_0x8bf1('0x3b')]=_[_0x8bf1('0x3e')](_0x1d9f52[_0x8bf1('0x3b')],{'$or':_[_0x8bf1('0x29')](_0x52d911,function(_0xbc6af8){if(_0xbc6af8[_0x8bf1('0x2d')]!==_0x8bf1('0x3f')){var _0x2d7a5d={};_0x2d7a5d[_0xbc6af8[_0x8bf1('0x28')]]={'$like':'%'+_0x22d8ac[_0x8bf1('0x30')][_0x8bf1('0x3d')]+'%'};return _0x2d7a5d;}})});}_0x1d9f52=_[_0x8bf1('0x3e')]({},_0x1d9f52,_0x22d8ac['options']);var _0x2d5b49={'where':_0x1d9f52[_0x8bf1('0x3b')]};return db[_0x8bf1('0x2a')]['count'](_0x2d5b49)['then'](function(_0x1c1883){_0x33cf25['count']=_0x1c1883;if(_0x22d8ac[_0x8bf1('0x30')][_0x8bf1('0x40')]){_0x1d9f52[_0x8bf1('0x41')]=[{'all':!![]}];}return db[_0x8bf1('0x2a')][_0x8bf1('0x42')](_0x1d9f52);})['then'](function(_0x45ec46){_0x33cf25[_0x8bf1('0x43')]=_0x45ec46;return _0x33cf25;})[_0x8bf1('0x24')](respondWithFilteredResult(_0x3723a4,_0x1d9f52))['catch'](handleError(_0x3723a4,null));};exports[_0x8bf1('0x44')]=function(_0x5293ed,_0xe91d7e){var _0x569362={'raw':!![],'where':{'id':_0x5293ed['params']['id']}},_0x7b3481={};_0x7b3481['model']=_[_0x8bf1('0x31')](db['CmCustomField'][_0x8bf1('0x2b')]);_0x7b3481[_0x8bf1('0x30')]=_[_0x8bf1('0x31')](_0x5293ed[_0x8bf1('0x30')]);_0x7b3481['filters']=_[_0x8bf1('0x33')](_0x7b3481[_0x8bf1('0x2f')],_0x7b3481[_0x8bf1('0x30')]);_0x569362[_0x8bf1('0x35')]=_[_0x8bf1('0x33')](_0x7b3481[_0x8bf1('0x2f')],qs[_0x8bf1('0x34')](_0x5293ed[_0x8bf1('0x30')]['fields']));_0x569362[_0x8bf1('0x35')]=_0x569362['attributes'][_0x8bf1('0x36')]?_0x569362[_0x8bf1('0x35')]:_0x7b3481['model'];if(_0x5293ed[_0x8bf1('0x30')][_0x8bf1('0x40')]){_0x569362['include']=[{'all':!![]}];}_0x569362=_[_0x8bf1('0x3e')]({},_0x569362,_0x5293ed[_0x8bf1('0x45')]);return db[_0x8bf1('0x2a')][_0x8bf1('0x46')](_0x569362)[_0x8bf1('0x24')](handleEntityNotFound(_0xe91d7e,null))['then'](respondWithResult(_0xe91d7e,null))[_0x8bf1('0x47')](handleError(_0xe91d7e,null));};exports[_0x8bf1('0x23')]=function(_0x48e975,_0x4c387f){if(_0x48e975[_0x8bf1('0x48')]['id']){delete _0x48e975[_0x8bf1('0x48')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x48e975[_0x8bf1('0x49')]['id']}})[_0x8bf1('0x24')](handleEntityNotFound(_0x4c387f,null))['then'](saveUpdates(_0x48e975[_0x8bf1('0x48')],null))[_0x8bf1('0x24')](respondWithResult(_0x4c387f,null))[_0x8bf1('0x47')](handleError(_0x4c387f,null));};exports[_0x8bf1('0x4a')]=function(_0x92fd3e,_0x2ed445){return db[_0x8bf1('0x2a')][_0x8bf1('0x46')]({'where':{'id':_0x92fd3e[_0x8bf1('0x49')]['id']}})[_0x8bf1('0x24')](handleEntityNotFound(_0x2ed445,null))[_0x8bf1('0x24')](removeEntity(_0x2ed445,null))['catch'](handleError(_0x2ed445,null));};exports[_0x8bf1('0x4b')]=function(_0x49dfc5,_0x237842){var _0xfdf27;return db[_0x8bf1('0x4c')]['transaction'](function(_0x517159){return db[_0x8bf1('0x2a')][_0x8bf1('0x4b')](_0x49dfc5[_0x8bf1('0x48')],{'transaction':_0x517159})[_0x8bf1('0x24')](function(_0x38bcd1){_0xfdf27=_0x38bcd1;var _0x31c2de={'type':db[_0x8bf1('0x4d')][_0x8bf1('0x4e')],'transaction':_0x517159};switch(_0x49dfc5[_0x8bf1('0x48')][_0x8bf1('0x2d')]){case _0x8bf1('0x4f'):_0x31c2de[_0x8bf1('0x2d')]=db['Sequelize'][_0x8bf1('0x4e')];break;case _0x8bf1('0x50'):_0x31c2de['type']=db[_0x8bf1('0x4d')][_0x8bf1('0x51')];break;case'switch':_0x31c2de[_0x8bf1('0x2d')]=db[_0x8bf1('0x4d')][_0x8bf1('0x52')];_0x31c2de[_0x8bf1('0x53')]=![];break;default:}return db[_0x8bf1('0x4c')][_0x8bf1('0x54')][_0x8bf1('0x55')](_0x8bf1('0x56'),util[_0x8bf1('0x57')](_0x8bf1('0x58'),_0xfdf27['id']),_0x31c2de);})['then'](function(){return _0xfdf27;});})[_0x8bf1('0x24')](respondWithResult(_0x237842,0xc9))['catch'](handleError(_0x237842,null));};
\ No newline at end of file
+var _0x50c0=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','CmCustomField','includeAll','findAll','rows','catch','show','params','length','find','body','create','transaction','Sequelize','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','type','key','model','differenceBy','keys','query'];(function(_0x219935,_0x5b7d02){var _0x130409=function(_0x56409e){while(--_0x56409e){_0x219935['push'](_0x219935['shift']());}};_0x130409(++_0x5b7d02);}(_0x50c0,0x11c));var _0x050c=function(_0x1ba2e5,_0xbcc3fb){_0x1ba2e5=_0x1ba2e5-0x0;var _0x2b8957=_0x50c0[_0x1ba2e5];return _0x2b8957;};'use strict';var emlformat=require(_0x050c('0x0'));var rimraf=require(_0x050c('0x1'));var zipdir=require(_0x050c('0x2'));var jsonpatch=require(_0x050c('0x3'));var rp=require(_0x050c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x050c('0x5'));var util=require('util');var path=require('path');var sox=require(_0x050c('0x6'));var csv=require('to-csv');var ejs=require(_0x050c('0x7'));var fs=require('fs');var fs_extra=require(_0x050c('0x8'));var _=require(_0x050c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x050c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x050c('0xb'));var querystring=require(_0x050c('0xc'));var Papa=require(_0x050c('0xd'));var Redis=require(_0x050c('0xe'));var authService=require(_0x050c('0xf'));var qs=require(_0x050c('0x10'));var as=require(_0x050c('0x11'));var hardwareService=require(_0x050c('0x12'));var logger=require(_0x050c('0x13'))('api');var utils=require(_0x050c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x050c('0x15'));var db=require(_0x050c('0x16'))['db'];function respondWithStatusCode(_0x2154e2,_0xadd0e8){_0xadd0e8=_0xadd0e8||0xcc;return function(_0x54ac7c){if(_0x54ac7c){return _0x2154e2[_0x050c('0x17')](_0xadd0e8);}return _0x2154e2['status'](_0xadd0e8)['end']();};}function respondWithResult(_0x502dd7,_0x1180bb){_0x1180bb=_0x1180bb||0xc8;return function(_0x29c97e){if(_0x29c97e){return _0x502dd7[_0x050c('0x18')](_0x1180bb)[_0x050c('0x19')](_0x29c97e);}};}function respondWithFilteredResult(_0x15c20c,_0x5a0f21){return function(_0x52eee3){if(_0x52eee3){var _0x1f775d=typeof _0x5a0f21[_0x050c('0x1a')]===_0x050c('0x1b')&&typeof _0x5a0f21['limit']===_0x050c('0x1b');var _0xf29781=_0x52eee3['count'];var _0x3039a8=_0x1f775d?0x0:_0x5a0f21[_0x050c('0x1a')];var _0x174e7e=_0x1f775d?_0x52eee3[_0x050c('0x1c')]:_0x5a0f21[_0x050c('0x1a')]+_0x5a0f21[_0x050c('0x1d')];var _0x81d33e;if(_0x174e7e>=_0xf29781){_0x174e7e=_0xf29781;_0x81d33e=0xc8;}else{_0x81d33e=0xce;}_0x15c20c['status'](_0x81d33e);return _0x15c20c[_0x050c('0x1e')](_0x050c('0x1f'),_0x3039a8+'-'+_0x174e7e+'/'+_0xf29781)[_0x050c('0x19')](_0x52eee3);}return null;};}function patchUpdates(_0xb3cb39){return function(_0x5a978e){try{jsonpatch['apply'](_0x5a978e,_0xb3cb39,!![]);}catch(_0x23104e){return BPromise[_0x050c('0x20')](_0x23104e);}return _0x5a978e[_0x050c('0x21')]();};}function saveUpdates(_0x31b29c,_0x571f32){return function(_0xd05d71){if(_0xd05d71){return _0xd05d71[_0x050c('0x22')](_0x31b29c)[_0x050c('0x23')](function(_0x4a339b){return _0x4a339b;});}return null;};}function removeEntity(_0x4ddbd4,_0x3687f3){return function(_0x5bf5f6){if(_0x5bf5f6){return _0x5bf5f6[_0x050c('0x24')]()[_0x050c('0x23')](function(){_0x4ddbd4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xddac93,_0x3c47dc){return function(_0x126719){if(!_0x126719){_0xddac93[_0x050c('0x17')](0x194);}return _0x126719;};}function handleError(_0x759f87,_0x4f9003){_0x4f9003=_0x4f9003||0x1f4;return function(_0x220f86){logger['error'](_0x220f86[_0x050c('0x25')]);if(_0x220f86[_0x050c('0x26')]){delete _0x220f86[_0x050c('0x26')];}_0x759f87[_0x050c('0x18')](_0x4f9003)['send'](_0x220f86);};}exports[_0x050c('0x27')]=function(_0x39719c,_0x2df277){var _0x3518a6={},_0x5ae832={},_0x49fa19={'count':0x0,'rows':[]};var _0x46b217=_[_0x050c('0x28')](db['CmCustomField'][_0x050c('0x29')],function(_0x2c196f){return{'name':_0x2c196f['fieldName'],'type':_0x2c196f[_0x050c('0x2a')][_0x050c('0x2b')]};});_0x5ae832[_0x050c('0x2c')]=_[_0x050c('0x2d')](_[_0x050c('0x28')](_0x46b217,_0x050c('0x26')),['name']);_0x5ae832['query']=_[_0x050c('0x2e')](_0x39719c[_0x050c('0x2f')]);_0x5ae832[_0x050c('0x30')]=_[_0x050c('0x31')](_0x5ae832['model'],_0x5ae832['query']);_0x3518a6[_0x050c('0x32')]=_[_0x050c('0x31')](_0x5ae832[_0x050c('0x2c')],qs[_0x050c('0x33')](_0x39719c[_0x050c('0x2f')][_0x050c('0x33')]));_0x3518a6[_0x050c('0x32')]=_0x3518a6[_0x050c('0x32')]['length']?_0x3518a6[_0x050c('0x32')]:_0x5ae832[_0x050c('0x2c')];if(!_0x39719c[_0x050c('0x2f')][_0x050c('0x34')](_0x050c('0x35'))){_0x3518a6[_0x050c('0x1d')]=qs[_0x050c('0x1d')](_0x39719c[_0x050c('0x2f')][_0x050c('0x1d')]);_0x3518a6['offset']=qs[_0x050c('0x1a')](_0x39719c[_0x050c('0x2f')][_0x050c('0x1a')]);}_0x3518a6[_0x050c('0x36')]=qs[_0x050c('0x37')](_0x39719c[_0x050c('0x2f')][_0x050c('0x37')]);_0x3518a6['where']=qs['filters'](_[_0x050c('0x38')](_0x39719c[_0x050c('0x2f')],_0x5ae832['filters']),_0x46b217);if(_0x39719c['query'][_0x050c('0x39')]){_0x3518a6['where']=_[_0x050c('0x3a')](_0x3518a6[_0x050c('0x3b')],{'$or':_['map'](_0x46b217,function(_0xbbf4d8){if(_0xbbf4d8['type']!==_0x050c('0x3c')){var _0x28d562={};_0x28d562[_0xbbf4d8[_0x050c('0x26')]]={'$like':'%'+_0x39719c[_0x050c('0x2f')]['filter']+'%'};return _0x28d562;}})});}_0x3518a6=_['merge']({},_0x3518a6,_0x39719c[_0x050c('0x3d')]);var _0x22e6f0={'where':_0x3518a6[_0x050c('0x3b')]};return db[_0x050c('0x3e')][_0x050c('0x1c')](_0x22e6f0)[_0x050c('0x23')](function(_0x25c34f){_0x49fa19[_0x050c('0x1c')]=_0x25c34f;if(_0x39719c[_0x050c('0x2f')][_0x050c('0x3f')]){_0x3518a6['include']=[{'all':!![]}];}return db[_0x050c('0x3e')][_0x050c('0x40')](_0x3518a6);})[_0x050c('0x23')](function(_0x34b4bf){_0x49fa19[_0x050c('0x41')]=_0x34b4bf;return _0x49fa19;})['then'](respondWithFilteredResult(_0x2df277,_0x3518a6))[_0x050c('0x42')](handleError(_0x2df277,null));};exports[_0x050c('0x43')]=function(_0x324d66,_0xb93403){var _0x5a0e8e={'raw':!![],'where':{'id':_0x324d66[_0x050c('0x44')]['id']}},_0x59128f={};_0x59128f[_0x050c('0x2c')]=_['keys'](db['CmCustomField'][_0x050c('0x29')]);_0x59128f[_0x050c('0x2f')]=_[_0x050c('0x2e')](_0x324d66['query']);_0x59128f[_0x050c('0x30')]=_[_0x050c('0x31')](_0x59128f[_0x050c('0x2c')],_0x59128f[_0x050c('0x2f')]);_0x5a0e8e[_0x050c('0x32')]=_[_0x050c('0x31')](_0x59128f[_0x050c('0x2c')],qs['fields'](_0x324d66[_0x050c('0x2f')][_0x050c('0x33')]));_0x5a0e8e['attributes']=_0x5a0e8e[_0x050c('0x32')][_0x050c('0x45')]?_0x5a0e8e[_0x050c('0x32')]:_0x59128f[_0x050c('0x2c')];if(_0x324d66['query'][_0x050c('0x3f')]){_0x5a0e8e['include']=[{'all':!![]}];}_0x5a0e8e=_[_0x050c('0x3a')]({},_0x5a0e8e,_0x324d66[_0x050c('0x3d')]);return db[_0x050c('0x3e')][_0x050c('0x46')](_0x5a0e8e)['then'](handleEntityNotFound(_0xb93403,null))['then'](respondWithResult(_0xb93403,null))[_0x050c('0x42')](handleError(_0xb93403,null));};exports[_0x050c('0x22')]=function(_0x5626f7,_0x167be0){if(_0x5626f7[_0x050c('0x47')]['id']){delete _0x5626f7['body']['id'];}return db[_0x050c('0x3e')][_0x050c('0x46')]({'where':{'id':_0x5626f7[_0x050c('0x44')]['id']}})[_0x050c('0x23')](handleEntityNotFound(_0x167be0,null))[_0x050c('0x23')](saveUpdates(_0x5626f7[_0x050c('0x47')],null))['then'](respondWithResult(_0x167be0,null))[_0x050c('0x42')](handleError(_0x167be0,null));};exports['destroy']=function(_0x2be3a5,_0x1bfa1b){return db[_0x050c('0x3e')][_0x050c('0x46')]({'where':{'id':_0x2be3a5[_0x050c('0x44')]['id']}})[_0x050c('0x23')](handleEntityNotFound(_0x1bfa1b,null))[_0x050c('0x23')](removeEntity(_0x1bfa1b,null))[_0x050c('0x42')](handleError(_0x1bfa1b,null));};exports[_0x050c('0x48')]=function(_0x40992b,_0x208602){var _0x252015;return db['sequelize'][_0x050c('0x49')](function(_0x4c27b9){return db[_0x050c('0x3e')]['create'](_0x40992b[_0x050c('0x47')],{'transaction':_0x4c27b9})[_0x050c('0x23')](function(_0x2a326d){_0x252015=_0x2a326d;var _0x3aaab1={'type':db[_0x050c('0x4a')]['TEXT'],'transaction':_0x4c27b9};switch(_0x40992b[_0x050c('0x47')][_0x050c('0x2a')]){case'text':_0x3aaab1[_0x050c('0x2a')]=db[_0x050c('0x4a')]['TEXT'];break;case _0x050c('0x4b'):_0x3aaab1[_0x050c('0x2a')]=db[_0x050c('0x4a')][_0x050c('0x4c')];break;case'switch':_0x3aaab1['type']=db['Sequelize'][_0x050c('0x4d')];_0x3aaab1[_0x050c('0x4e')]=![];break;default:}return db[_0x050c('0x4f')][_0x050c('0x50')][_0x050c('0x51')](_0x050c('0x52'),util['format']('cf_%d',_0x252015['id']),_0x3aaab1);})[_0x050c('0x23')](function(){return _0x252015;});})[_0x050c('0x23')](respondWithResult(_0x208602,0xc9))['catch'](handleError(_0x208602,null));};
\ No newline at end of file