X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fapi%2FcmContact%2FcmContact.rpc.js;h=00db23ae5a2172189e6785f7906587768d8ef9c0;hb=ff1c11e14fca8d30ba993bf9ad292fb70d9b0b0b;hp=8574f771c3278ed29c60289003b4071fdcf13fe0;hpb=3b6ec49862a5197d06e7453a43d40dcd68709ea0;p=motion2.git diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 8574f77..00db23a 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 _0xcb9f=['info','debug','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmContact,\x20%s,\x20%s','message','result','catch','GetCmContact','CmContact','findAll','options','raw','where','attributes','limit','include','model','map','CreateCmContact','create','body','then','keys','startsWith','cf_','update','set','id\x20=\x20?','sequelize','lodash','util','moment','ioredis','squel','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./cmContact.socket','request'];(function(_0x54cef6,_0x146b0e){var _0x39aacf=function(_0x21993e){while(--_0x21993e){_0x54cef6['push'](_0x54cef6['shift']());}};_0x39aacf(++_0x146b0e);}(_0xcb9f,0x1c8));var _0xfcb9=function(_0x7c95a9,_0x52ea9f){_0x7c95a9=_0x7c95a9-0x0;var _0x70995c=_0xcb9f[_0x7c95a9];return _0x70995c;};'use strict';var _=require(_0xfcb9('0x0'));var util=require(_0xfcb9('0x1'));var moment=require(_0xfcb9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcb9('0x3'));var squel=require(_0xfcb9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfcb9('0x5'))(_0xfcb9('0x6'));var config=require(_0xfcb9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfcb9('0x8')]({'port':0x232a});config[_0xfcb9('0x9')]=_[_0xfcb9('0xa')](config[_0xfcb9('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcb9('0xb'))(new Redis(config[_0xfcb9('0x9')]));require(_0xfcb9('0xc'))['register'](socket);function respondWithRpcPromise(_0x9eb824,_0x2499fa,_0x1f30bf){return new BPromise(function(_0x28b843,_0xb0f960){return client[_0xfcb9('0xd')](_0x9eb824,_0x1f30bf)['then'](function(_0x4d3a15){logger[_0xfcb9('0xe')]('CmContact,\x20%s,\x20%s',_0x2499fa,'request\x20sent');logger[_0xfcb9('0xf')](_0xfcb9('0x10'),_0x2499fa,_0xfcb9('0x11'),JSON[_0xfcb9('0x12')](_0x4d3a15));if(_0x4d3a15['error']){if(_0x4d3a15[_0xfcb9('0x13')][_0xfcb9('0x14')]===0x1f4){logger[_0xfcb9('0x13')](_0xfcb9('0x15'),_0x2499fa,_0x4d3a15['error'][_0xfcb9('0x16')]);return _0xb0f960(_0x4d3a15[_0xfcb9('0x13')][_0xfcb9('0x16')]);}logger[_0xfcb9('0x13')]('CmContact,\x20%s,\x20%s',_0x2499fa,_0x4d3a15[_0xfcb9('0x13')][_0xfcb9('0x16')]);return _0x28b843(_0x4d3a15[_0xfcb9('0x13')][_0xfcb9('0x16')]);}else{logger['info'](_0xfcb9('0x15'),_0x2499fa,_0xfcb9('0x11'));_0x28b843(_0x4d3a15[_0xfcb9('0x17')][_0xfcb9('0x16')]);}})[_0xfcb9('0x18')](function(_0x35b3e2){logger[_0xfcb9('0x13')](_0xfcb9('0x15'),_0x2499fa,_0x35b3e2);_0xb0f960(_0x35b3e2);});});}exports[_0xfcb9('0x19')]=function(_0x1d6dc3){var _0xcc9640=this;return new Promise(function(_0x1c7989,_0x2927b9){return db[_0xfcb9('0x1a')][_0xfcb9('0x1b')]({'raw':_0x1d6dc3[_0xfcb9('0x1c')]?_0x1d6dc3[_0xfcb9('0x1c')][_0xfcb9('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d6dc3[_0xfcb9('0x1c')]?_0x1d6dc3[_0xfcb9('0x1c')][_0xfcb9('0x1e')]||null:null,'attributes':_0x1d6dc3[_0xfcb9('0x1c')]?_0x1d6dc3[_0xfcb9('0x1c')][_0xfcb9('0x1f')]||null:null,'limit':_0x1d6dc3[_0xfcb9('0x1c')]?_0x1d6dc3[_0xfcb9('0x1c')][_0xfcb9('0x20')]||null:null,'include':_0x1d6dc3[_0xfcb9('0x1c')]?_0x1d6dc3[_0xfcb9('0x1c')][_0xfcb9('0x21')]?_['map'](_0x1d6dc3[_0xfcb9('0x1c')][_0xfcb9('0x21')],function(_0x46a26f){return{'model':db[_0x46a26f[_0xfcb9('0x22')]],'as':_0x46a26f['as'],'attributes':_0x46a26f[_0xfcb9('0x1f')],'include':_0x46a26f[_0xfcb9('0x21')]?_['map'](_0x46a26f['include'],function(_0x5aabc0){return{'model':db[_0x5aabc0[_0xfcb9('0x22')]],'as':_0x5aabc0['as'],'attributes':_0x5aabc0[_0xfcb9('0x1f')],'include':_0x5aabc0['include']?_[_0xfcb9('0x23')](_0x5aabc0['include'],function(_0x1685ed){return{'model':db[_0x1685ed['model']],'as':_0x1685ed['as'],'attributes':_0x1685ed[_0xfcb9('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x160524){logger['info']('GetCmContact',_0x1d6dc3);logger['debug'](_0xfcb9('0x19'),_0x1d6dc3,JSON[_0xfcb9('0x12')](_0x160524));_0x1c7989(_0x160524);})[_0xfcb9('0x18')](function(_0x59c9fd){logger[_0xfcb9('0x13')](_0xfcb9('0x19'),_0x59c9fd['message'],_0x1d6dc3);_0x2927b9(_0xcc9640['error'](0x1f4,_0x59c9fd['message']));});});};exports[_0xfcb9('0x24')]=function(_0x19e7d8){var _0x5c5457=this;return new Promise(function(_0x3cfc87,_0x38ea87){return db[_0xfcb9('0x1a')][_0xfcb9('0x25')](_0x19e7d8[_0xfcb9('0x26')],{'raw':_0x19e7d8[_0xfcb9('0x1c')]?_0x19e7d8[_0xfcb9('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xfcb9('0x27')](function(_0x269753){var _0x403723;for(var _0x2c59dd=0x0;_0x2c59dd