Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / cmCustomField / cmCustomField.controller.js
index daf473b..22848d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60f1=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','destroy','send','map','CmCustomField','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','merge','where','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','update','body','find','create','sequelize','Sequelize','TEXT','text','INTEGER','switch','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2b4df5,_0x2fc06b){var _0x43b54c=function(_0xa570cf){while(--_0xa570cf){_0x2b4df5['push'](_0x2b4df5['shift']());}};_0x43b54c(++_0x2fc06b);}(_0x60f1,0x93));var _0x160f=function(_0x19dd8a,_0x4af545){_0x19dd8a=_0x19dd8a-0x0;var _0x6245d3=_0x60f1[_0x19dd8a];return _0x6245d3;};'use strict';var pdf=require(_0x160f('0x0'));var emlformat=require(_0x160f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x160f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x160f('0x3'));var moment=require(_0x160f('0x4'));var BPromise=require(_0x160f('0x5'));var Mustache=require(_0x160f('0x6'));var util=require(_0x160f('0x7'));var path=require(_0x160f('0x8'));var sox=require(_0x160f('0x9'));var csv=require(_0x160f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x160f('0xb'));var crypto=require(_0x160f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x160f('0xd'));var toCsv=require(_0x160f('0xa'));var querystring=require(_0x160f('0xe'));var Papa=require('papaparse');var Redis=require(_0x160f('0xf'));var authService=require(_0x160f('0x10'));var qs=require(_0x160f('0x11'));var as=require(_0x160f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x160f('0x13'))(_0x160f('0x14'));var utils=require(_0x160f('0x15'));var config=require(_0x160f('0x16'));var db=require(_0x160f('0x17'))['db'];function respondWithStatusCode(_0x446e79,_0x4465cf){_0x4465cf=_0x4465cf||0xcc;return function(_0x318a25){if(_0x318a25){return _0x446e79[_0x160f('0x18')](_0x4465cf);}return _0x446e79[_0x160f('0x19')](_0x4465cf)[_0x160f('0x1a')]();};}function respondWithResult(_0x1e1d56,_0x2b0c30){_0x2b0c30=_0x2b0c30||0xc8;return function(_0x4e1e09){if(_0x4e1e09){return _0x1e1d56['status'](_0x2b0c30)[_0x160f('0x1b')](_0x4e1e09);}};}function respondWithFilteredResult(_0x2e6871,_0x45d39f){return function(_0x132ac7){if(_0x132ac7){var _0x91f07=_0x132ac7[_0x160f('0x1c')],_0x11777d=_0x45d39f[_0x160f('0x1d')],_0x146384=_0x45d39f[_0x160f('0x1d')]+_0x45d39f[_0x160f('0x1e')],_0x4b00ef;if(_0x146384>=_0x91f07){_0x146384=_0x91f07;_0x4b00ef=0xc8;}else{_0x4b00ef=0xce;}_0x2e6871['status'](_0x4b00ef);return _0x2e6871[_0x160f('0x1f')](_0x160f('0x20'),_0x11777d+'-'+_0x146384+'/'+_0x91f07)['json'](_0x132ac7);}return null;};}function patchUpdates(_0x27b317){return function(_0x2a3e50){try{jsonpatch['apply'](_0x2a3e50,_0x27b317,!![]);}catch(_0x4bb14f){return BPromise[_0x160f('0x21')](_0x4bb14f);}return _0x2a3e50['save']();};}function saveUpdates(_0x38aeb9,_0x3eb606){return function(_0x49d82f){if(_0x49d82f){return _0x49d82f['update'](_0x38aeb9)[_0x160f('0x22')](function(_0x4b88cb){return _0x4b88cb;});}return null;};}function removeEntity(_0xd5176b,_0x4eb260){return function(_0x505713){if(_0x505713){return _0x505713[_0x160f('0x23')]()[_0x160f('0x22')](function(){_0xd5176b[_0x160f('0x19')](0xcc)[_0x160f('0x1a')]();});}};}function handleEntityNotFound(_0x5da274,_0x3f4ba4){return function(_0x3d64f1){if(!_0x3d64f1){_0x5da274['sendStatus'](0x194);}return _0x3d64f1;};}function handleError(_0x202318,_0x2de5f0){_0x2de5f0=_0x2de5f0||0x1f4;return function(_0x3a0162){logger['error'](_0x3a0162['stack']);if(_0x3a0162['name']){delete _0x3a0162['name'];}_0x202318['status'](_0x2de5f0)[_0x160f('0x24')](_0x3a0162);};}exports['index']=function(_0x4fe1b1,_0x4fab64){var _0x36b236={},_0xed7fc4={},_0x3dd22f={'count':0x0,'rows':[]};var _0x411458=_[_0x160f('0x25')](db[_0x160f('0x26')][_0x160f('0x27')],function(_0x2f03bd){return{'name':_0x2f03bd[_0x160f('0x28')],'type':_0x2f03bd['type'][_0x160f('0x29')]};});_0xed7fc4[_0x160f('0x2a')]=_['differenceBy'](_[_0x160f('0x25')](_0x411458,'name'),[_0x160f('0x2b')]);_0xed7fc4[_0x160f('0x2c')]=_[_0x160f('0x2d')](_0x4fe1b1[_0x160f('0x2c')]);_0xed7fc4['filters']=_[_0x160f('0x2e')](_0xed7fc4[_0x160f('0x2a')],_0xed7fc4[_0x160f('0x2c')]);_0x36b236[_0x160f('0x2f')]=_['intersection'](_0xed7fc4[_0x160f('0x2a')],qs[_0x160f('0x30')](_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x30')]));_0x36b236[_0x160f('0x2f')]=_0x36b236[_0x160f('0x2f')][_0x160f('0x31')]?_0x36b236[_0x160f('0x2f')]:_0xed7fc4[_0x160f('0x2a')];if(!_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x32')]('nolimit')){_0x36b236[_0x160f('0x1e')]=qs[_0x160f('0x1e')](_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x1e')]);_0x36b236[_0x160f('0x1d')]=qs['offset'](_0x4fe1b1['query'][_0x160f('0x1d')]);}_0x36b236[_0x160f('0x33')]=qs[_0x160f('0x34')](_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x34')]);_0x36b236['where']=qs['filters'](_[_0x160f('0x35')](_0x4fe1b1['query'],_0xed7fc4[_0x160f('0x36')]),_0x411458);if(_0x4fe1b1[_0x160f('0x2c')]['filter']){_0x36b236['where']=_[_0x160f('0x37')](_0x36b236[_0x160f('0x38')],{'$or':_[_0x160f('0x25')](_0x411458,function(_0x1a8334){if(_0x1a8334[_0x160f('0x39')]!==_0x160f('0x3a')){var _0x4136ef={};_0x4136ef[_0x1a8334['name']]={'$like':'%'+_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x3b')]+'%'};return _0x4136ef;}})});}_0x36b236=_[_0x160f('0x37')]({},_0x36b236,_0x4fe1b1['options']);var _0x2ca701={'where':_0x36b236[_0x160f('0x38')]};return db['CmCustomField'][_0x160f('0x1c')](_0x2ca701)[_0x160f('0x22')](function(_0x3de3d0){_0x3dd22f[_0x160f('0x1c')]=_0x3de3d0;if(_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x3c')]){_0x36b236[_0x160f('0x3d')]=[{'all':!![]}];}return db[_0x160f('0x26')][_0x160f('0x3e')](_0x36b236);})[_0x160f('0x22')](function(_0x520899){_0x3dd22f[_0x160f('0x3f')]=_0x520899;return _0x3dd22f;})[_0x160f('0x22')](respondWithFilteredResult(_0x4fab64,_0x36b236))[_0x160f('0x40')](handleError(_0x4fab64,null));};exports[_0x160f('0x41')]=function(_0x4d1a7a,_0x276349){var _0x2f3938={'raw':!![],'where':{'id':_0x4d1a7a[_0x160f('0x42')]['id']}},_0x48449c={};_0x48449c[_0x160f('0x2a')]=_[_0x160f('0x2d')](db['CmCustomField'][_0x160f('0x27')]);_0x48449c[_0x160f('0x2c')]=_['keys'](_0x4d1a7a[_0x160f('0x2c')]);_0x48449c[_0x160f('0x36')]=_[_0x160f('0x2e')](_0x48449c[_0x160f('0x2a')],_0x48449c[_0x160f('0x2c')]);_0x2f3938[_0x160f('0x2f')]=_[_0x160f('0x2e')](_0x48449c['model'],qs['fields'](_0x4d1a7a[_0x160f('0x2c')]['fields']));_0x2f3938[_0x160f('0x2f')]=_0x2f3938['attributes']['length']?_0x2f3938['attributes']:_0x48449c[_0x160f('0x2a')];if(_0x4d1a7a[_0x160f('0x2c')]['includeAll']){_0x2f3938['include']=[{'all':!![]}];}_0x2f3938=_['merge']({},_0x2f3938,_0x4d1a7a[_0x160f('0x43')]);return db[_0x160f('0x26')]['find'](_0x2f3938)[_0x160f('0x22')](handleEntityNotFound(_0x276349,null))[_0x160f('0x22')](respondWithResult(_0x276349,null))[_0x160f('0x40')](handleError(_0x276349,null));};exports[_0x160f('0x44')]=function(_0xc9dd58,_0x243f92){if(_0xc9dd58['body']['id']){delete _0xc9dd58[_0x160f('0x45')]['id'];}return db[_0x160f('0x26')][_0x160f('0x46')]({'where':{'id':_0xc9dd58['params']['id']}})[_0x160f('0x22')](handleEntityNotFound(_0x243f92,null))['then'](saveUpdates(_0xc9dd58['body'],null))[_0x160f('0x22')](respondWithResult(_0x243f92,null))[_0x160f('0x40')](handleError(_0x243f92,null));};exports[_0x160f('0x23')]=function(_0xf9b7c3,_0x1ee582){return db[_0x160f('0x26')][_0x160f('0x46')]({'where':{'id':_0xf9b7c3[_0x160f('0x42')]['id']}})[_0x160f('0x22')](handleEntityNotFound(_0x1ee582,null))[_0x160f('0x22')](removeEntity(_0x1ee582,null))[_0x160f('0x40')](handleError(_0x1ee582,null));};exports[_0x160f('0x47')]=function(_0x1eda5a,_0x1e5a41){var _0x4204d2;return db[_0x160f('0x48')]['transaction'](function(_0x56bcd4){return db[_0x160f('0x26')][_0x160f('0x47')](_0x1eda5a[_0x160f('0x45')],{'transaction':_0x56bcd4})[_0x160f('0x22')](function(_0x2a5b7f){_0x4204d2=_0x2a5b7f;var _0x1c7823={'type':db[_0x160f('0x49')][_0x160f('0x4a')],'transaction':_0x56bcd4};switch(_0x1eda5a[_0x160f('0x45')][_0x160f('0x39')]){case _0x160f('0x4b'):_0x1c7823[_0x160f('0x39')]=db[_0x160f('0x49')]['TEXT'];break;case'number':_0x1c7823[_0x160f('0x39')]=db['Sequelize'][_0x160f('0x4c')];break;case _0x160f('0x4d'):_0x1c7823['type']=db[_0x160f('0x49')]['BOOLEAN'];_0x1c7823['defaultValue']=![];break;default:}return db[_0x160f('0x48')][_0x160f('0x4e')][_0x160f('0x4f')](_0x160f('0x50'),util[_0x160f('0x51')](_0x160f('0x52'),_0x4204d2['id']),_0x1c7823);})[_0x160f('0x22')](function(){return _0x4204d2;});})[_0x160f('0x22')](respondWithResult(_0x1e5a41,0xc9))[_0x160f('0x40')](handleError(_0x1e5a41,null));};
\ No newline at end of file
+var _0xf3b0=['crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','save','update','destroy','then','error','name','send','index','CmCustomField','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','find','body','sequelize','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xf3b0,0x17f));var _0x0f3b=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0xf3b0[_0x5b077b];return _0x16faf7;};'use strict';var pdf=require(_0x0f3b('0x0'));var emlformat=require(_0x0f3b('0x1'));var rimraf=require(_0x0f3b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f3b('0x3'));var rp=require('request-promise');var moment=require(_0x0f3b('0x4'));var BPromise=require(_0x0f3b('0x5'));var Mustache=require('mustache');var util=require(_0x0f3b('0x6'));var path=require(_0x0f3b('0x7'));var sox=require(_0x0f3b('0x8'));var csv=require(_0x0f3b('0x9'));var ejs=require(_0x0f3b('0xa'));var fs=require('fs');var _=require(_0x0f3b('0xb'));var squel=require('squel');var crypto=require(_0x0f3b('0xc'));var jsforce=require(_0x0f3b('0xd'));var deskjs=require(_0x0f3b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f3b('0xf'));var Papa=require(_0x0f3b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f3b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f3b('0x12'))('api');var utils=require(_0x0f3b('0x13'));var config=require(_0x0f3b('0x14'));var db=require(_0x0f3b('0x15'))['db'];function respondWithStatusCode(_0x118fa4,_0xf16079){_0xf16079=_0xf16079||0xcc;return function(_0x545775){if(_0x545775){return _0x118fa4[_0x0f3b('0x16')](_0xf16079);}return _0x118fa4[_0x0f3b('0x17')](_0xf16079)[_0x0f3b('0x18')]();};}function respondWithResult(_0x581bcd,_0x253def){_0x253def=_0x253def||0xc8;return function(_0x177a21){if(_0x177a21){return _0x581bcd[_0x0f3b('0x17')](_0x253def)[_0x0f3b('0x19')](_0x177a21);}};}function respondWithFilteredResult(_0x56661d,_0x199476){return function(_0x52bef9){if(_0x52bef9){var _0x42789c=_0x52bef9['count'],_0x540a86=_0x199476[_0x0f3b('0x1a')],_0x5128dc=_0x199476['offset']+_0x199476[_0x0f3b('0x1b')],_0x22c4ec;if(_0x5128dc>=_0x42789c){_0x5128dc=_0x42789c;_0x22c4ec=0xc8;}else{_0x22c4ec=0xce;}_0x56661d[_0x0f3b('0x17')](_0x22c4ec);return _0x56661d[_0x0f3b('0x1c')]('Content-Range',_0x540a86+'-'+_0x5128dc+'/'+_0x42789c)[_0x0f3b('0x19')](_0x52bef9);}return null;};}function patchUpdates(_0x33ed5c){return function(_0x30c018){try{jsonpatch['apply'](_0x30c018,_0x33ed5c,!![]);}catch(_0xc71003){return BPromise['reject'](_0xc71003);}return _0x30c018[_0x0f3b('0x1d')]();};}function saveUpdates(_0x14c40c,_0x4ec30b){return function(_0x154423){if(_0x154423){return _0x154423[_0x0f3b('0x1e')](_0x14c40c)['then'](function(_0x48262b){return _0x48262b;});}return null;};}function removeEntity(_0x1bf520,_0x35d9a7){return function(_0x480011){if(_0x480011){return _0x480011[_0x0f3b('0x1f')]()[_0x0f3b('0x20')](function(){_0x1bf520[_0x0f3b('0x17')](0xcc)[_0x0f3b('0x18')]();});}};}function handleEntityNotFound(_0x275db5,_0x467376){return function(_0x3a1002){if(!_0x3a1002){_0x275db5[_0x0f3b('0x16')](0x194);}return _0x3a1002;};}function handleError(_0x524050,_0x3d7399){_0x3d7399=_0x3d7399||0x1f4;return function(_0x4d1b52){logger[_0x0f3b('0x21')](_0x4d1b52['stack']);if(_0x4d1b52[_0x0f3b('0x22')]){delete _0x4d1b52[_0x0f3b('0x22')];}_0x524050[_0x0f3b('0x17')](_0x3d7399)[_0x0f3b('0x23')](_0x4d1b52);};}exports[_0x0f3b('0x24')]=function(_0x56ad5c,_0x429a4e){var _0x183505={},_0x219114={},_0xcdaf7d={'count':0x0,'rows':[]};var _0x250066=_['map'](db[_0x0f3b('0x25')]['rawAttributes'],function(_0x1df74e){return{'name':_0x1df74e[_0x0f3b('0x26')],'type':_0x1df74e['type'][_0x0f3b('0x27')]};});_0x219114[_0x0f3b('0x28')]=_['differenceBy'](_[_0x0f3b('0x29')](_0x250066,_0x0f3b('0x22')),[_0x0f3b('0x22')]);_0x219114['query']=_[_0x0f3b('0x2a')](_0x56ad5c['query']);_0x219114[_0x0f3b('0x2b')]=_[_0x0f3b('0x2c')](_0x219114['model'],_0x219114[_0x0f3b('0x2d')]);_0x183505[_0x0f3b('0x2e')]=_[_0x0f3b('0x2c')](_0x219114[_0x0f3b('0x28')],qs[_0x0f3b('0x2f')](_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x2f')]));_0x183505[_0x0f3b('0x2e')]=_0x183505['attributes'][_0x0f3b('0x30')]?_0x183505[_0x0f3b('0x2e')]:_0x219114[_0x0f3b('0x28')];if(!_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x31')](_0x0f3b('0x32'))){_0x183505[_0x0f3b('0x1b')]=qs[_0x0f3b('0x1b')](_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x1b')]);_0x183505[_0x0f3b('0x1a')]=qs[_0x0f3b('0x1a')](_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x1a')]);}_0x183505[_0x0f3b('0x33')]=qs['sort'](_0x56ad5c[_0x0f3b('0x2d')]['sort']);_0x183505[_0x0f3b('0x34')]=qs[_0x0f3b('0x2b')](_[_0x0f3b('0x35')](_0x56ad5c[_0x0f3b('0x2d')],_0x219114['filters']),_0x250066);if(_0x56ad5c['query'][_0x0f3b('0x36')]){_0x183505[_0x0f3b('0x34')]=_[_0x0f3b('0x37')](_0x183505[_0x0f3b('0x34')],{'$or':_[_0x0f3b('0x29')](_0x250066,function(_0x355ce2){if(_0x355ce2[_0x0f3b('0x38')]!=='VIRTUAL'){var _0x296a4b={};_0x296a4b[_0x355ce2[_0x0f3b('0x22')]]={'$like':'%'+_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x36')]+'%'};return _0x296a4b;}})});}_0x183505=_[_0x0f3b('0x37')]({},_0x183505,_0x56ad5c[_0x0f3b('0x39')]);var _0x1ed696={'where':_0x183505[_0x0f3b('0x34')]};return db['CmCustomField']['count'](_0x1ed696)[_0x0f3b('0x20')](function(_0x5eccda){_0xcdaf7d['count']=_0x5eccda;if(_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x3a')]){_0x183505[_0x0f3b('0x3b')]=[{'all':!![]}];}return db[_0x0f3b('0x25')][_0x0f3b('0x3c')](_0x183505);})[_0x0f3b('0x20')](function(_0x1e971a){_0xcdaf7d[_0x0f3b('0x3d')]=_0x1e971a;return _0xcdaf7d;})[_0x0f3b('0x20')](respondWithFilteredResult(_0x429a4e,_0x183505))[_0x0f3b('0x3e')](handleError(_0x429a4e,null));};exports['show']=function(_0x572d98,_0x58b09f){var _0x1736d9={'raw':!![],'where':{'id':_0x572d98[_0x0f3b('0x3f')]['id']}},_0x281538={};_0x281538[_0x0f3b('0x28')]=_[_0x0f3b('0x2a')](db['CmCustomField']['rawAttributes']);_0x281538['query']=_[_0x0f3b('0x2a')](_0x572d98['query']);_0x281538[_0x0f3b('0x2b')]=_[_0x0f3b('0x2c')](_0x281538[_0x0f3b('0x28')],_0x281538[_0x0f3b('0x2d')]);_0x1736d9['attributes']=_['intersection'](_0x281538[_0x0f3b('0x28')],qs[_0x0f3b('0x2f')](_0x572d98[_0x0f3b('0x2d')][_0x0f3b('0x2f')]));_0x1736d9[_0x0f3b('0x2e')]=_0x1736d9['attributes'][_0x0f3b('0x30')]?_0x1736d9[_0x0f3b('0x2e')]:_0x281538['model'];if(_0x572d98[_0x0f3b('0x2d')][_0x0f3b('0x3a')]){_0x1736d9[_0x0f3b('0x3b')]=[{'all':!![]}];}_0x1736d9=_[_0x0f3b('0x37')]({},_0x1736d9,_0x572d98[_0x0f3b('0x39')]);return db[_0x0f3b('0x25')][_0x0f3b('0x40')](_0x1736d9)[_0x0f3b('0x20')](handleEntityNotFound(_0x58b09f,null))['then'](respondWithResult(_0x58b09f,null))[_0x0f3b('0x3e')](handleError(_0x58b09f,null));};exports[_0x0f3b('0x1e')]=function(_0x462f4b,_0x1d29b4){if(_0x462f4b[_0x0f3b('0x41')]['id']){delete _0x462f4b['body']['id'];}return db[_0x0f3b('0x25')][_0x0f3b('0x40')]({'where':{'id':_0x462f4b[_0x0f3b('0x3f')]['id']}})[_0x0f3b('0x20')](handleEntityNotFound(_0x1d29b4,null))[_0x0f3b('0x20')](saveUpdates(_0x462f4b[_0x0f3b('0x41')],null))[_0x0f3b('0x20')](respondWithResult(_0x1d29b4,null))[_0x0f3b('0x3e')](handleError(_0x1d29b4,null));};exports[_0x0f3b('0x1f')]=function(_0xf81ee3,_0x4e5120){return db[_0x0f3b('0x25')]['find']({'where':{'id':_0xf81ee3['params']['id']}})['then'](handleEntityNotFound(_0x4e5120,null))['then'](removeEntity(_0x4e5120,null))['catch'](handleError(_0x4e5120,null));};exports['create']=function(_0x529c76,_0x2b6976){var _0x31e541;return db[_0x0f3b('0x42')][_0x0f3b('0x43')](function(_0x5e2907){return db[_0x0f3b('0x25')]['create'](_0x529c76[_0x0f3b('0x41')],{'transaction':_0x5e2907})[_0x0f3b('0x20')](function(_0x2ff48c){_0x31e541=_0x2ff48c;var _0x32cfba={'type':db[_0x0f3b('0x44')][_0x0f3b('0x45')],'transaction':_0x5e2907};switch(_0x529c76[_0x0f3b('0x41')][_0x0f3b('0x38')]){case _0x0f3b('0x46'):_0x32cfba[_0x0f3b('0x38')]=db[_0x0f3b('0x44')][_0x0f3b('0x45')];break;case _0x0f3b('0x47'):_0x32cfba['type']=db[_0x0f3b('0x44')]['INTEGER'];break;case _0x0f3b('0x48'):_0x32cfba[_0x0f3b('0x38')]=db[_0x0f3b('0x44')][_0x0f3b('0x49')];_0x32cfba[_0x0f3b('0x4a')]=![];break;default:}return db[_0x0f3b('0x42')][_0x0f3b('0x4b')][_0x0f3b('0x4c')]('cm_contacts',util[_0x0f3b('0x4d')](_0x0f3b('0x4e'),_0x31e541['id']),_0x32cfba);})[_0x0f3b('0x20')](function(){return _0x31e541;});})[_0x0f3b('0x20')](respondWithResult(_0x2b6976,0xc9))[_0x0f3b('0x3e')](handleError(_0x2b6976,null));};
\ No newline at end of file