X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fapi%2FcmContact%2FcmContact.rpc.js;h=1003a3b48901866c5ed50821e16eac840b77fd1f;hb=de6f27d8824ffb29cbf937050a12378469af9a53;hp=52a290261521326feeff720f5e7e38f39d2103fd;hpb=180439628549c979093908f0b833833689fb8374;p=motion2.git diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 52a2902..1003a3b 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf564=['CreateCmContact','create','keys','length','body','startsWith','cf_','update','table','cm_contacts','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','randomstring','ioredis','squel','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./cmContact.socket','register','request','then','info','debug','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmContact,\x20%s,\x20%s','message','result','GetCmContact','CmContact','findAll','options','raw','attributes','include','map','model','catch'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0xf564,0x14d));var _0x4f56=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0xf564[_0x56608c];return _0x3c7fb0;};'use strict';var _=require(_0x4f56('0x0'));var util=require(_0x4f56('0x1'));var moment=require(_0x4f56('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f56('0x3'));var fs=require('fs');var Redis=require(_0x4f56('0x4'));var squel=require(_0x4f56('0x5'));var db=require(_0x4f56('0x6'))['db'];var utils=require(_0x4f56('0x7'));var logger=require(_0x4f56('0x8'))('rpc');var config=require(_0x4f56('0x9'));var jayson=require(_0x4f56('0xa'));var client=jayson['client'][_0x4f56('0xb')]({'port':0x232a});config[_0x4f56('0xc')]=_[_0x4f56('0xd')](config['redis'],{'host':_0x4f56('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f56('0xc')]));require(_0x4f56('0xf'))[_0x4f56('0x10')](socket);function respondWithRpcPromise(_0x193468,_0x2ad047,_0x2e57a4){return new BPromise(function(_0x663ec7,_0x4d8c3a){return client[_0x4f56('0x11')](_0x193468,_0x2e57a4)[_0x4f56('0x12')](function(_0x11885c){logger[_0x4f56('0x13')]('CmContact,\x20%s,\x20%s',_0x2ad047,'request\x20sent');logger[_0x4f56('0x14')](_0x4f56('0x15'),_0x2ad047,_0x4f56('0x16'),JSON[_0x4f56('0x17')](_0x11885c));if(_0x11885c[_0x4f56('0x18')]){if(_0x11885c['error']['code']===0x1f4){logger[_0x4f56('0x18')](_0x4f56('0x19'),_0x2ad047,_0x11885c[_0x4f56('0x18')][_0x4f56('0x1a')]);return _0x4d8c3a(_0x11885c[_0x4f56('0x18')][_0x4f56('0x1a')]);}logger[_0x4f56('0x18')]('CmContact,\x20%s,\x20%s',_0x2ad047,_0x11885c[_0x4f56('0x18')][_0x4f56('0x1a')]);return _0x663ec7(_0x11885c['error'][_0x4f56('0x1a')]);}else{logger[_0x4f56('0x13')](_0x4f56('0x19'),_0x2ad047,_0x4f56('0x16'));_0x663ec7(_0x11885c[_0x4f56('0x1b')][_0x4f56('0x1a')]);}})['catch'](function(_0x5836b1){logger[_0x4f56('0x18')]('CmContact,\x20%s,\x20%s',_0x2ad047,_0x5836b1);_0x4d8c3a(_0x5836b1);});});}exports[_0x4f56('0x1c')]=function(_0x20ec36){var _0x31c7e7=this;return new Promise(function(_0x4b4a8d,_0x96e6fb){return db[_0x4f56('0x1d')][_0x4f56('0x1e')]({'raw':_0x20ec36[_0x4f56('0x1f')]?_0x20ec36[_0x4f56('0x1f')][_0x4f56('0x20')]===undefined?!![]:![]:!![],'where':_0x20ec36['options']?_0x20ec36[_0x4f56('0x1f')]['where']||null:null,'attributes':_0x20ec36[_0x4f56('0x1f')]?_0x20ec36[_0x4f56('0x1f')][_0x4f56('0x21')]||null:null,'limit':_0x20ec36[_0x4f56('0x1f')]?_0x20ec36['options']['limit']||null:null,'include':_0x20ec36[_0x4f56('0x1f')]?_0x20ec36['options']['include']?_['map'](_0x20ec36[_0x4f56('0x1f')][_0x4f56('0x22')],function(_0x1e58aa){return{'model':db[_0x1e58aa['model']],'as':_0x1e58aa['as'],'attributes':_0x1e58aa[_0x4f56('0x21')],'include':_0x1e58aa['include']?_[_0x4f56('0x23')](_0x1e58aa[_0x4f56('0x22')],function(_0x2545a9){return{'model':db[_0x2545a9[_0x4f56('0x24')]],'as':_0x2545a9['as'],'attributes':_0x2545a9[_0x4f56('0x21')],'include':_0x2545a9[_0x4f56('0x22')]?_[_0x4f56('0x23')](_0x2545a9[_0x4f56('0x22')],function(_0x30a400){return{'model':db[_0x30a400[_0x4f56('0x24')]],'as':_0x30a400['as'],'attributes':_0x30a400[_0x4f56('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4f56('0x12')](function(_0x4fbc4d){logger[_0x4f56('0x13')](_0x4f56('0x1c'),_0x20ec36);logger[_0x4f56('0x14')]('GetCmContact',_0x20ec36,JSON[_0x4f56('0x17')](_0x4fbc4d));_0x4b4a8d(_0x4fbc4d);})[_0x4f56('0x25')](function(_0x2f7e14){logger[_0x4f56('0x18')](_0x4f56('0x1c'),_0x2f7e14[_0x4f56('0x1a')],_0x20ec36);_0x96e6fb(_0x31c7e7[_0x4f56('0x18')](0x1f4,_0x2f7e14[_0x4f56('0x1a')]));});});};exports[_0x4f56('0x26')]=function(_0x385dcf){var _0x54fc8c=this;return new Promise(function(_0x5b2dbe,_0x1a4258){return db[_0x4f56('0x1d')][_0x4f56('0x27')](_0x385dcf['body'],{'raw':_0x385dcf[_0x4f56('0x1f')]?_0x385dcf[_0x4f56('0x1f')][_0x4f56('0x20')]===undefined?!![]:![]:!![]})[_0x4f56('0x12')](function(_0x40c501){var _0x584657;for(var _0x4c6c8e=0x0;_0x4c6c8e