Built motion from commit (unavailable).|2.5.10
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index 0341572..d9c52f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba64=['to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','CmCustomField','rawAttributes','key','model','differenceBy','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','Sequelize','TEXT','type','text','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox'];(function(_0x1f1500,_0x2085e0){var _0x28b555=function(_0x30fb64){while(--_0x30fb64){_0x1f1500['push'](_0x1f1500['shift']());}};_0x28b555(++_0x2085e0);}(_0xba64,0x1ef));var _0x4ba6=function(_0x3f3aff,_0x5ed722){_0x3f3aff=_0x3f3aff-0x0;var _0x453996=_0xba64[_0x3f3aff];return _0x453996;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4ba6('0x0'));var rimraf=require(_0x4ba6('0x1'));var zipdir=require(_0x4ba6('0x2'));var jsonpatch=require(_0x4ba6('0x3'));var rp=require('request-promise');var moment=require(_0x4ba6('0x4'));var BPromise=require(_0x4ba6('0x5'));var Mustache=require('mustache');var util=require(_0x4ba6('0x6'));var path=require(_0x4ba6('0x7'));var sox=require(_0x4ba6('0x8'));var csv=require(_0x4ba6('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4ba6('0xa'));var crypto=require(_0x4ba6('0xb'));var jsforce=require(_0x4ba6('0xc'));var deskjs=require(_0x4ba6('0xd'));var toCsv=require(_0x4ba6('0x9'));var querystring=require(_0x4ba6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4ba6('0xf'));var qs=require(_0x4ba6('0x10'));var as=require(_0x4ba6('0x11'));var hardwareService=require(_0x4ba6('0x12'));var logger=require(_0x4ba6('0x13'))(_0x4ba6('0x14'));var utils=require(_0x4ba6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba6('0x16'));var db=require(_0x4ba6('0x17'))['db'];function respondWithStatusCode(_0x303ff0,_0x1fc891){_0x1fc891=_0x1fc891||0xcc;return function(_0x2a2cf6){if(_0x2a2cf6){return _0x303ff0[_0x4ba6('0x18')](_0x1fc891);}return _0x303ff0[_0x4ba6('0x19')](_0x1fc891)['end']();};}function respondWithResult(_0xaa8888,_0x1d118d){_0x1d118d=_0x1d118d||0xc8;return function(_0x136027){if(_0x136027){return _0xaa8888[_0x4ba6('0x19')](_0x1d118d)['json'](_0x136027);}};}function respondWithFilteredResult(_0x26c50d,_0x3bbe47){return function(_0x546b91){if(_0x546b91){var _0x542571=_0x546b91[_0x4ba6('0x1a')],_0x3bc0f7=_0x3bbe47[_0x4ba6('0x1b')],_0x3a6ff4=_0x3bbe47['offset']+_0x3bbe47[_0x4ba6('0x1c')],_0x1460fd;if(_0x3a6ff4>=_0x542571){_0x3a6ff4=_0x542571;_0x1460fd=0xc8;}else{_0x1460fd=0xce;}_0x26c50d['status'](_0x1460fd);return _0x26c50d[_0x4ba6('0x1d')](_0x4ba6('0x1e'),_0x3bc0f7+'-'+_0x3a6ff4+'/'+_0x542571)[_0x4ba6('0x1f')](_0x546b91);}return null;};}function patchUpdates(_0x7e7a18){return function(_0x121a3e){try{jsonpatch['apply'](_0x121a3e,_0x7e7a18,!![]);}catch(_0x3787c9){return BPromise[_0x4ba6('0x20')](_0x3787c9);}return _0x121a3e[_0x4ba6('0x21')]();};}function saveUpdates(_0x35f1ab,_0x2febf9){return function(_0x55f468){if(_0x55f468){return _0x55f468[_0x4ba6('0x22')](_0x35f1ab)[_0x4ba6('0x23')](function(_0x3ca495){return _0x3ca495;});}return null;};}function removeEntity(_0x3cbbca,_0x2a3a8f){return function(_0x19da88){if(_0x19da88){return _0x19da88[_0x4ba6('0x24')]()['then'](function(){_0x3cbbca[_0x4ba6('0x19')](0xcc)[_0x4ba6('0x25')]();});}};}function handleEntityNotFound(_0xc32955,_0x38c341){return function(_0xb876cb){if(!_0xb876cb){_0xc32955[_0x4ba6('0x18')](0x194);}return _0xb876cb;};}function handleError(_0x24f611,_0x90f30b){_0x90f30b=_0x90f30b||0x1f4;return function(_0x247e9d){logger[_0x4ba6('0x26')](_0x247e9d['stack']);if(_0x247e9d[_0x4ba6('0x27')]){delete _0x247e9d[_0x4ba6('0x27')];}_0x24f611['status'](_0x90f30b)[_0x4ba6('0x28')](_0x247e9d);};}exports['index']=function(_0x2e4eac,_0xe97d02){var _0x2e442e={},_0x52b9f6={},_0x16ac90={'count':0x0,'rows':[]};var _0x570797=_['map'](db[_0x4ba6('0x29')][_0x4ba6('0x2a')],function(_0x57a26e){return{'name':_0x57a26e['fieldName'],'type':_0x57a26e['type'][_0x4ba6('0x2b')]};});_0x52b9f6[_0x4ba6('0x2c')]=_[_0x4ba6('0x2d')](_[_0x4ba6('0x2e')](_0x570797,_0x4ba6('0x27')),[_0x4ba6('0x27')]);_0x52b9f6[_0x4ba6('0x2f')]=_[_0x4ba6('0x30')](_0x2e4eac[_0x4ba6('0x2f')]);_0x52b9f6[_0x4ba6('0x31')]=_[_0x4ba6('0x32')](_0x52b9f6[_0x4ba6('0x2c')],_0x52b9f6[_0x4ba6('0x2f')]);_0x2e442e['attributes']=_[_0x4ba6('0x32')](_0x52b9f6['model'],qs[_0x4ba6('0x33')](_0x2e4eac[_0x4ba6('0x2f')]['fields']));_0x2e442e[_0x4ba6('0x34')]=_0x2e442e['attributes'][_0x4ba6('0x35')]?_0x2e442e[_0x4ba6('0x34')]:_0x52b9f6[_0x4ba6('0x2c')];if(!_0x2e4eac[_0x4ba6('0x2f')][_0x4ba6('0x36')]('nolimit')){_0x2e442e[_0x4ba6('0x1c')]=qs[_0x4ba6('0x1c')](_0x2e4eac[_0x4ba6('0x2f')][_0x4ba6('0x1c')]);_0x2e442e[_0x4ba6('0x1b')]=qs[_0x4ba6('0x1b')](_0x2e4eac[_0x4ba6('0x2f')][_0x4ba6('0x1b')]);}_0x2e442e[_0x4ba6('0x37')]=qs['sort'](_0x2e4eac[_0x4ba6('0x2f')][_0x4ba6('0x38')]);_0x2e442e[_0x4ba6('0x39')]=qs[_0x4ba6('0x31')](_['pick'](_0x2e4eac['query'],_0x52b9f6[_0x4ba6('0x31')]),_0x570797);if(_0x2e4eac[_0x4ba6('0x2f')]['filter']){_0x2e442e['where']=_['merge'](_0x2e442e[_0x4ba6('0x39')],{'$or':_[_0x4ba6('0x2e')](_0x570797,function(_0x5ea3c3){if(_0x5ea3c3['type']!==_0x4ba6('0x3a')){var _0x321e0d={};_0x321e0d[_0x5ea3c3[_0x4ba6('0x27')]]={'$like':'%'+_0x2e4eac[_0x4ba6('0x2f')][_0x4ba6('0x3b')]+'%'};return _0x321e0d;}})});}_0x2e442e=_['merge']({},_0x2e442e,_0x2e4eac[_0x4ba6('0x3c')]);var _0x44888a={'where':_0x2e442e[_0x4ba6('0x39')]};return db[_0x4ba6('0x29')][_0x4ba6('0x1a')](_0x44888a)[_0x4ba6('0x23')](function(_0x530579){_0x16ac90[_0x4ba6('0x1a')]=_0x530579;if(_0x2e4eac['query'][_0x4ba6('0x3d')]){_0x2e442e[_0x4ba6('0x3e')]=[{'all':!![]}];}return db[_0x4ba6('0x29')][_0x4ba6('0x3f')](_0x2e442e);})[_0x4ba6('0x23')](function(_0x13a8ed){_0x16ac90[_0x4ba6('0x40')]=_0x13a8ed;return _0x16ac90;})[_0x4ba6('0x23')](respondWithFilteredResult(_0xe97d02,_0x2e442e))[_0x4ba6('0x41')](handleError(_0xe97d02,null));};exports[_0x4ba6('0x42')]=function(_0x1bccc1,_0x2772dd){var _0x5b87a6={'raw':!![],'where':{'id':_0x1bccc1[_0x4ba6('0x43')]['id']}},_0x1255b1={};_0x1255b1['model']=_[_0x4ba6('0x30')](db['CmCustomField'][_0x4ba6('0x2a')]);_0x1255b1['query']=_[_0x4ba6('0x30')](_0x1bccc1[_0x4ba6('0x2f')]);_0x1255b1['filters']=_[_0x4ba6('0x32')](_0x1255b1[_0x4ba6('0x2c')],_0x1255b1[_0x4ba6('0x2f')]);_0x5b87a6[_0x4ba6('0x34')]=_[_0x4ba6('0x32')](_0x1255b1[_0x4ba6('0x2c')],qs['fields'](_0x1bccc1[_0x4ba6('0x2f')][_0x4ba6('0x33')]));_0x5b87a6[_0x4ba6('0x34')]=_0x5b87a6[_0x4ba6('0x34')][_0x4ba6('0x35')]?_0x5b87a6[_0x4ba6('0x34')]:_0x1255b1['model'];if(_0x1bccc1[_0x4ba6('0x2f')][_0x4ba6('0x3d')]){_0x5b87a6[_0x4ba6('0x3e')]=[{'all':!![]}];}_0x5b87a6=_['merge']({},_0x5b87a6,_0x1bccc1[_0x4ba6('0x3c')]);return db[_0x4ba6('0x29')][_0x4ba6('0x44')](_0x5b87a6)[_0x4ba6('0x23')](handleEntityNotFound(_0x2772dd,null))[_0x4ba6('0x23')](respondWithResult(_0x2772dd,null))[_0x4ba6('0x41')](handleError(_0x2772dd,null));};exports[_0x4ba6('0x22')]=function(_0x515c86,_0x5cb2c3){if(_0x515c86[_0x4ba6('0x45')]['id']){delete _0x515c86[_0x4ba6('0x45')]['id'];}return db[_0x4ba6('0x29')]['find']({'where':{'id':_0x515c86[_0x4ba6('0x43')]['id']}})[_0x4ba6('0x23')](handleEntityNotFound(_0x5cb2c3,null))[_0x4ba6('0x23')](saveUpdates(_0x515c86['body'],null))['then'](respondWithResult(_0x5cb2c3,null))['catch'](handleError(_0x5cb2c3,null));};exports[_0x4ba6('0x24')]=function(_0x2eec3a,_0x4c462e){return db[_0x4ba6('0x29')]['find']({'where':{'id':_0x2eec3a[_0x4ba6('0x43')]['id']}})[_0x4ba6('0x23')](handleEntityNotFound(_0x4c462e,null))[_0x4ba6('0x23')](removeEntity(_0x4c462e,null))[_0x4ba6('0x41')](handleError(_0x4c462e,null));};exports[_0x4ba6('0x46')]=function(_0x19d7b0,_0xf1822e){var _0x17d41a;return db['sequelize']['transaction'](function(_0x51bea5){return db[_0x4ba6('0x29')][_0x4ba6('0x46')](_0x19d7b0[_0x4ba6('0x45')],{'transaction':_0x51bea5})['then'](function(_0x2d0ea4){_0x17d41a=_0x2d0ea4;var _0xdaa48e={'type':db[_0x4ba6('0x47')][_0x4ba6('0x48')],'transaction':_0x51bea5};switch(_0x19d7b0[_0x4ba6('0x45')][_0x4ba6('0x49')]){case _0x4ba6('0x4a'):_0xdaa48e['type']=db['Sequelize']['TEXT'];break;case _0x4ba6('0x4b'):_0xdaa48e['type']=db[_0x4ba6('0x47')][_0x4ba6('0x4c')];break;case _0x4ba6('0x4d'):_0xdaa48e['type']=db[_0x4ba6('0x47')]['BOOLEAN'];_0xdaa48e[_0x4ba6('0x4e')]=![];break;default:}return db[_0x4ba6('0x4f')][_0x4ba6('0x50')][_0x4ba6('0x51')](_0x4ba6('0x52'),util['format'](_0x4ba6('0x53'),_0x17d41a['id']),_0xdaa48e);})[_0x4ba6('0x23')](function(){return _0x17d41a;});})[_0x4ba6('0x23')](respondWithResult(_0xf1822e,0xc9))[_0x4ba6('0x41')](handleError(_0xf1822e,null));};
\ No newline at end of file
+var _0xbd19=['bluebird','mustache','util','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','error','stack','name','send','map','CmCustomField','rawAttributes','fieldName','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','then','rows','show','params','find','catch','body','create','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','zip-dir','fast-json-patch','moment'];(function(_0x101a9d,_0x2e2f72){var _0x305198=function(_0x39667a){while(--_0x39667a){_0x101a9d['push'](_0x101a9d['shift']());}};_0x305198(++_0x2e2f72);}(_0xbd19,0x192));var _0x9bd1=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xbd19[_0x4f9b18];return _0x29f20c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9bd1('0x0'));var jsonpatch=require(_0x9bd1('0x1'));var rp=require('request-promise');var moment=require(_0x9bd1('0x2'));var BPromise=require(_0x9bd1('0x3'));var Mustache=require(_0x9bd1('0x4'));var util=require(_0x9bd1('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9bd1('0x6'));var fs=require('fs');var _=require(_0x9bd1('0x7'));var squel=require(_0x9bd1('0x8'));var crypto=require('crypto');var jsforce=require(_0x9bd1('0x9'));var deskjs=require(_0x9bd1('0xa'));var toCsv=require(_0x9bd1('0xb'));var querystring=require('querystring');var Papa=require(_0x9bd1('0xc'));var Redis=require(_0x9bd1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9bd1('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9bd1('0xf'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2beb8f,_0x3829ed){_0x3829ed=_0x3829ed||0xcc;return function(_0x16bc57){if(_0x16bc57){return _0x2beb8f[_0x9bd1('0x10')](_0x3829ed);}return _0x2beb8f[_0x9bd1('0x11')](_0x3829ed)[_0x9bd1('0x12')]();};}function respondWithResult(_0x224385,_0x331d60){_0x331d60=_0x331d60||0xc8;return function(_0x22dbe0){if(_0x22dbe0){return _0x224385['status'](_0x331d60)[_0x9bd1('0x13')](_0x22dbe0);}};}function respondWithFilteredResult(_0x3f0a21,_0x2a70c5){return function(_0x44373c){if(_0x44373c){var _0x3a398d=_0x44373c[_0x9bd1('0x14')],_0x5df6fd=_0x2a70c5[_0x9bd1('0x15')],_0x5d5c7b=_0x2a70c5[_0x9bd1('0x15')]+_0x2a70c5[_0x9bd1('0x16')],_0x13747f;if(_0x5d5c7b>=_0x3a398d){_0x5d5c7b=_0x3a398d;_0x13747f=0xc8;}else{_0x13747f=0xce;}_0x3f0a21[_0x9bd1('0x11')](_0x13747f);return _0x3f0a21[_0x9bd1('0x17')](_0x9bd1('0x18'),_0x5df6fd+'-'+_0x5d5c7b+'/'+_0x3a398d)['json'](_0x44373c);}return null;};}function patchUpdates(_0x3b8d40){return function(_0x473d24){try{jsonpatch[_0x9bd1('0x19')](_0x473d24,_0x3b8d40,!![]);}catch(_0x2ade05){return BPromise['reject'](_0x2ade05);}return _0x473d24[_0x9bd1('0x1a')]();};}function saveUpdates(_0x732e64,_0x484436){return function(_0x3c0188){if(_0x3c0188){return _0x3c0188[_0x9bd1('0x1b')](_0x732e64)['then'](function(_0x324b36){return _0x324b36;});}return null;};}function removeEntity(_0x4d57a9,_0x19e60b){return function(_0x23ddaf){if(_0x23ddaf){return _0x23ddaf[_0x9bd1('0x1c')]()['then'](function(){_0x4d57a9[_0x9bd1('0x11')](0xcc)[_0x9bd1('0x12')]();});}};}function handleEntityNotFound(_0x3384a6,_0x30c1ee){return function(_0x1979e3){if(!_0x1979e3){_0x3384a6['sendStatus'](0x194);}return _0x1979e3;};}function handleError(_0x334874,_0x19fb71){_0x19fb71=_0x19fb71||0x1f4;return function(_0x392fa7){logger[_0x9bd1('0x1d')](_0x392fa7[_0x9bd1('0x1e')]);if(_0x392fa7[_0x9bd1('0x1f')]){delete _0x392fa7[_0x9bd1('0x1f')];}_0x334874[_0x9bd1('0x11')](_0x19fb71)[_0x9bd1('0x20')](_0x392fa7);};}exports['index']=function(_0x3ac5c3,_0xd4b82e){var _0xd4e064={},_0xdee95d={},_0xa58896={'count':0x0,'rows':[]};var _0x140e85=_[_0x9bd1('0x21')](db[_0x9bd1('0x22')][_0x9bd1('0x23')],function(_0x46f350){return{'name':_0x46f350[_0x9bd1('0x24')],'type':_0x46f350['type']['key']};});_0xdee95d[_0x9bd1('0x25')]=_[_0x9bd1('0x26')](_['map'](_0x140e85,'name'),[_0x9bd1('0x1f')]);_0xdee95d['query']=_[_0x9bd1('0x27')](_0x3ac5c3[_0x9bd1('0x28')]);_0xdee95d[_0x9bd1('0x29')]=_[_0x9bd1('0x2a')](_0xdee95d[_0x9bd1('0x25')],_0xdee95d['query']);_0xd4e064[_0x9bd1('0x2b')]=_[_0x9bd1('0x2a')](_0xdee95d[_0x9bd1('0x25')],qs[_0x9bd1('0x2c')](_0x3ac5c3['query']['fields']));_0xd4e064[_0x9bd1('0x2b')]=_0xd4e064['attributes'][_0x9bd1('0x2d')]?_0xd4e064[_0x9bd1('0x2b')]:_0xdee95d[_0x9bd1('0x25')];if(!_0x3ac5c3[_0x9bd1('0x28')][_0x9bd1('0x2e')](_0x9bd1('0x2f'))){_0xd4e064['limit']=qs[_0x9bd1('0x16')](_0x3ac5c3[_0x9bd1('0x28')][_0x9bd1('0x16')]);_0xd4e064[_0x9bd1('0x15')]=qs[_0x9bd1('0x15')](_0x3ac5c3[_0x9bd1('0x28')][_0x9bd1('0x15')]);}_0xd4e064[_0x9bd1('0x30')]=qs[_0x9bd1('0x31')](_0x3ac5c3[_0x9bd1('0x28')][_0x9bd1('0x31')]);_0xd4e064[_0x9bd1('0x32')]=qs[_0x9bd1('0x29')](_[_0x9bd1('0x33')](_0x3ac5c3[_0x9bd1('0x28')],_0xdee95d[_0x9bd1('0x29')]),_0x140e85);if(_0x3ac5c3[_0x9bd1('0x28')][_0x9bd1('0x34')]){_0xd4e064[_0x9bd1('0x32')]=_['merge'](_0xd4e064[_0x9bd1('0x32')],{'$or':_[_0x9bd1('0x21')](_0x140e85,function(_0x5d7811){if(_0x5d7811[_0x9bd1('0x35')]!==_0x9bd1('0x36')){var _0x11cce4={};_0x11cce4[_0x5d7811['name']]={'$like':'%'+_0x3ac5c3[_0x9bd1('0x28')]['filter']+'%'};return _0x11cce4;}})});}_0xd4e064=_[_0x9bd1('0x37')]({},_0xd4e064,_0x3ac5c3[_0x9bd1('0x38')]);var _0x1ea6a3={'where':_0xd4e064[_0x9bd1('0x32')]};return db['CmCustomField']['count'](_0x1ea6a3)['then'](function(_0x5808eb){_0xa58896[_0x9bd1('0x14')]=_0x5808eb;if(_0x3ac5c3['query'][_0x9bd1('0x39')]){_0xd4e064[_0x9bd1('0x3a')]=[{'all':!![]}];}return db['CmCustomField'][_0x9bd1('0x3b')](_0xd4e064);})[_0x9bd1('0x3c')](function(_0x138c81){_0xa58896[_0x9bd1('0x3d')]=_0x138c81;return _0xa58896;})[_0x9bd1('0x3c')](respondWithFilteredResult(_0xd4b82e,_0xd4e064))['catch'](handleError(_0xd4b82e,null));};exports[_0x9bd1('0x3e')]=function(_0x2fe42b,_0x568c43){var _0x2a1110={'raw':!![],'where':{'id':_0x2fe42b[_0x9bd1('0x3f')]['id']}},_0x2c4430={};_0x2c4430[_0x9bd1('0x25')]=_[_0x9bd1('0x27')](db['CmCustomField'][_0x9bd1('0x23')]);_0x2c4430['query']=_[_0x9bd1('0x27')](_0x2fe42b['query']);_0x2c4430[_0x9bd1('0x29')]=_[_0x9bd1('0x2a')](_0x2c4430['model'],_0x2c4430[_0x9bd1('0x28')]);_0x2a1110[_0x9bd1('0x2b')]=_[_0x9bd1('0x2a')](_0x2c4430['model'],qs['fields'](_0x2fe42b[_0x9bd1('0x28')]['fields']));_0x2a1110[_0x9bd1('0x2b')]=_0x2a1110[_0x9bd1('0x2b')][_0x9bd1('0x2d')]?_0x2a1110['attributes']:_0x2c4430['model'];if(_0x2fe42b[_0x9bd1('0x28')][_0x9bd1('0x39')]){_0x2a1110['include']=[{'all':!![]}];}_0x2a1110=_[_0x9bd1('0x37')]({},_0x2a1110,_0x2fe42b[_0x9bd1('0x38')]);return db['CmCustomField'][_0x9bd1('0x40')](_0x2a1110)[_0x9bd1('0x3c')](handleEntityNotFound(_0x568c43,null))[_0x9bd1('0x3c')](respondWithResult(_0x568c43,null))[_0x9bd1('0x41')](handleError(_0x568c43,null));};exports[_0x9bd1('0x1b')]=function(_0x6081fc,_0x3dd4b0){if(_0x6081fc[_0x9bd1('0x42')]['id']){delete _0x6081fc['body']['id'];}return db[_0x9bd1('0x22')]['find']({'where':{'id':_0x6081fc[_0x9bd1('0x3f')]['id']}})[_0x9bd1('0x3c')](handleEntityNotFound(_0x3dd4b0,null))['then'](saveUpdates(_0x6081fc['body'],null))[_0x9bd1('0x3c')](respondWithResult(_0x3dd4b0,null))[_0x9bd1('0x41')](handleError(_0x3dd4b0,null));};exports[_0x9bd1('0x1c')]=function(_0x64cfe2,_0x344885){return db[_0x9bd1('0x22')][_0x9bd1('0x40')]({'where':{'id':_0x64cfe2[_0x9bd1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x344885,null))['then'](removeEntity(_0x344885,null))[_0x9bd1('0x41')](handleError(_0x344885,null));};exports[_0x9bd1('0x43')]=function(_0x5dc071,_0x2b8670){var _0x3e6c7c;return db['sequelize']['transaction'](function(_0x4bf30b){return db['CmCustomField']['create'](_0x5dc071[_0x9bd1('0x42')],{'transaction':_0x4bf30b})[_0x9bd1('0x3c')](function(_0xd7730){_0x3e6c7c=_0xd7730;var _0x373e71={'type':db[_0x9bd1('0x44')]['TEXT'],'transaction':_0x4bf30b};switch(_0x5dc071[_0x9bd1('0x42')][_0x9bd1('0x35')]){case _0x9bd1('0x45'):_0x373e71[_0x9bd1('0x35')]=db[_0x9bd1('0x44')][_0x9bd1('0x46')];break;case _0x9bd1('0x47'):_0x373e71[_0x9bd1('0x35')]=db[_0x9bd1('0x44')][_0x9bd1('0x48')];break;case'switch':_0x373e71[_0x9bd1('0x35')]=db[_0x9bd1('0x44')][_0x9bd1('0x49')];_0x373e71[_0x9bd1('0x4a')]=![];break;default:}return db[_0x9bd1('0x4b')][_0x9bd1('0x4c')][_0x9bd1('0x4d')](_0x9bd1('0x4e'),util[_0x9bd1('0x4f')](_0x9bd1('0x50'),_0x3e6c7c['id']),_0x373e71);})['then'](function(){return _0x3e6c7c;});})[_0x9bd1('0x3c')](respondWithResult(_0x2b8670,0xc9))[_0x9bd1('0x41')](handleError(_0x2b8670,null));};
\ No newline at end of file