Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index bd84129..30cad99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4016=['catch','GetZohoAccount','findAll','options','raw','where','attributes','include','map','model','debug','stringify','ShowZohoAccount','ZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x1f3135,_0x2c5097){var _0x48f9a1=function(_0x36f5b3){while(--_0x36f5b3){_0x1f3135['push'](_0x1f3135['shift']());}};_0x48f9a1(++_0x2c5097);}(_0x4016,0x1a2));var _0x6401=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4016[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x6401('0x0'));var moment=require(_0x6401('0x1'));var BPromise=require(_0x6401('0x2'));var rs=require(_0x6401('0x3'));var fs=require('fs');var Redis=require(_0x6401('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6401('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6401('0x6'));var client=jayson['client'][_0x6401('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x20f62a,_0x2fbe74,_0x51fd86){return new BPromise(function(_0x5f4179,_0x2f7051){return client[_0x6401('0x8')](_0x20f62a,_0x51fd86)[_0x6401('0x9')](function(_0x54e537){logger[_0x6401('0xa')](_0x6401('0xb'),_0x2fbe74,_0x6401('0xc'));logger['debug'](_0x6401('0xd'),_0x2fbe74,'request\x20sent',JSON['stringify'](_0x54e537));if(_0x54e537['error']){if(_0x54e537['error']['code']===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x2fbe74,_0x54e537[_0x6401('0xe')][_0x6401('0xf')]);return _0x2f7051(_0x54e537[_0x6401('0xe')][_0x6401('0xf')]);}logger[_0x6401('0xe')](_0x6401('0xb'),_0x2fbe74,_0x54e537[_0x6401('0xe')][_0x6401('0xf')]);return _0x5f4179(_0x54e537['error'][_0x6401('0xf')]);}else{logger[_0x6401('0xa')](_0x6401('0xb'),_0x2fbe74,_0x6401('0xc'));_0x5f4179(_0x54e537['result'][_0x6401('0xf')]);}})[_0x6401('0x10')](function(_0x5b2039){logger[_0x6401('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x2fbe74,_0x5b2039);_0x2f7051(_0x5b2039);});});}exports[_0x6401('0x11')]=function(_0x58466a){var _0x5826c5=this;return new Promise(function(_0x16a7a6,_0x14f551){return db['ZohoAccount'][_0x6401('0x12')]({'raw':_0x58466a[_0x6401('0x13')]?_0x58466a[_0x6401('0x13')][_0x6401('0x14')]===undefined?!![]:![]:!![],'where':_0x58466a['options']?_0x58466a[_0x6401('0x13')][_0x6401('0x15')]||null:null,'attributes':_0x58466a[_0x6401('0x13')]?_0x58466a[_0x6401('0x13')][_0x6401('0x16')]||null:null,'limit':_0x58466a[_0x6401('0x13')]?_0x58466a[_0x6401('0x13')]['limit']||null:null,'include':_0x58466a[_0x6401('0x13')]?_0x58466a[_0x6401('0x13')][_0x6401('0x17')]?_[_0x6401('0x18')](_0x58466a[_0x6401('0x13')][_0x6401('0x17')],function(_0x1e58cd){return{'model':db[_0x1e58cd[_0x6401('0x19')]],'as':_0x1e58cd['as'],'attributes':_0x1e58cd[_0x6401('0x16')],'include':_0x1e58cd[_0x6401('0x17')]?_['map'](_0x1e58cd[_0x6401('0x17')],function(_0x462771){return{'model':db[_0x462771[_0x6401('0x19')]],'as':_0x462771['as'],'attributes':_0x462771[_0x6401('0x16')],'include':_0x462771[_0x6401('0x17')]?_[_0x6401('0x18')](_0x462771[_0x6401('0x17')],function(_0x261640){return{'model':db[_0x261640[_0x6401('0x19')]],'as':_0x261640['as'],'attributes':_0x261640[_0x6401('0x16')]};}):[]};}):[]};}):[]:[]})[_0x6401('0x9')](function(_0x1655dc){logger[_0x6401('0xa')](_0x6401('0x11'),_0x58466a);logger[_0x6401('0x1a')]('GetZohoAccount',_0x58466a,JSON[_0x6401('0x1b')](_0x1655dc));_0x16a7a6(_0x1655dc);})[_0x6401('0x10')](function(_0x66419d){logger[_0x6401('0xe')]('GetZohoAccount',_0x66419d[_0x6401('0xf')],_0x58466a);_0x14f551(_0x5826c5['error'](0x1f4,_0x66419d[_0x6401('0xf')]));});});};exports[_0x6401('0x1c')]=function(_0x190894){var _0x553254=this;return new Promise(function(_0xc8911f,_0x3cf07f){return db[_0x6401('0x1d')][_0x6401('0x1e')]({'raw':_0x190894['options']?_0x190894[_0x6401('0x13')][_0x6401('0x14')]===undefined?!![]:![]:!![],'where':_0x190894['options']?_0x190894[_0x6401('0x13')][_0x6401('0x15')]||null:null,'attributes':_0x190894['options']?_0x190894[_0x6401('0x13')][_0x6401('0x16')]||null:null,'include':_0x190894[_0x6401('0x13')]?_0x190894[_0x6401('0x13')][_0x6401('0x17')]?_[_0x6401('0x18')](_0x190894['options'][_0x6401('0x17')],function(_0x5501d9){return{'model':db[_0x5501d9['model']],'as':_0x5501d9['as'],'attributes':_0x5501d9[_0x6401('0x16')],'include':_0x5501d9[_0x6401('0x17')]?_[_0x6401('0x18')](_0x5501d9[_0x6401('0x17')],function(_0x5743e8){return{'model':db[_0x5743e8['model']],'as':_0x5743e8['as'],'attributes':_0x5743e8[_0x6401('0x16')],'include':_0x5743e8['include']?_[_0x6401('0x18')](_0x5743e8['include'],function(_0x1aff5e){return{'model':db[_0x1aff5e[_0x6401('0x19')]],'as':_0x1aff5e['as'],'attributes':_0x1aff5e['attributes']};}):[]};}):[]};}):[]:[]})[_0x6401('0x9')](function(_0x2e98bb){logger['info'](_0x6401('0x1c'),_0x190894);logger[_0x6401('0x1a')](_0x6401('0x1c'),_0x190894,JSON[_0x6401('0x1b')](_0x2e98bb));_0xc8911f(_0x2e98bb);})['catch'](function(_0xd4a1e3){logger['error'](_0x6401('0x1c'),_0xd4a1e3[_0x6401('0xf')],_0x190894);_0x3cf07f(_0x553254[_0x6401('0xe')](0x1f4,_0xd4a1e3['message']));});});};
\ No newline at end of file
+var _0x3f74=['ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','find'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3f74,0x121));var _0x43f7=function(_0x268882,_0xc8f590){_0x268882=_0x268882-0x0;var _0x2548d8=_0x3f74[_0x268882];return _0x2548d8;};'use strict';var _=require(_0x43f7('0x0'));var util=require(_0x43f7('0x1'));var moment=require(_0x43f7('0x2'));var BPromise=require(_0x43f7('0x3'));var rs=require(_0x43f7('0x4'));var fs=require('fs');var Redis=require(_0x43f7('0x5'));var db=require(_0x43f7('0x6'))['db'];var utils=require(_0x43f7('0x7'));var logger=require('../../config/logger')(_0x43f7('0x8'));var config=require(_0x43f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x43f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f64a6,_0x1998e3,_0x574b8a){return new BPromise(function(_0x115f89,_0x65bccb){return client[_0x43f7('0xb')](_0x4f64a6,_0x574b8a)[_0x43f7('0xc')](function(_0x452e91){logger['info'](_0x43f7('0xd'),_0x1998e3,'request\x20sent');logger[_0x43f7('0xe')](_0x43f7('0xf'),_0x1998e3,'request\x20sent',JSON[_0x43f7('0x10')](_0x452e91));if(_0x452e91[_0x43f7('0x11')]){if(_0x452e91[_0x43f7('0x11')]['code']===0x1f4){logger[_0x43f7('0x11')](_0x43f7('0xd'),_0x1998e3,_0x452e91[_0x43f7('0x11')][_0x43f7('0x12')]);return _0x65bccb(_0x452e91[_0x43f7('0x11')][_0x43f7('0x12')]);}logger[_0x43f7('0x11')](_0x43f7('0xd'),_0x1998e3,_0x452e91[_0x43f7('0x11')][_0x43f7('0x12')]);return _0x115f89(_0x452e91[_0x43f7('0x11')][_0x43f7('0x12')]);}else{logger[_0x43f7('0x13')](_0x43f7('0xd'),_0x1998e3,_0x43f7('0x14'));_0x115f89(_0x452e91[_0x43f7('0x15')][_0x43f7('0x12')]);}})[_0x43f7('0x16')](function(_0x5ba55e){logger[_0x43f7('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x1998e3,_0x5ba55e);_0x65bccb(_0x5ba55e);});});}exports['GetZohoAccount']=function(_0x3d8571){var _0x5ce4ed=this;return new Promise(function(_0x44380f,_0x8c976a){return db[_0x43f7('0x17')][_0x43f7('0x18')]({'raw':_0x3d8571[_0x43f7('0x19')]?_0x3d8571['options'][_0x43f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d8571[_0x43f7('0x19')]?_0x3d8571['options'][_0x43f7('0x1b')]||null:null,'attributes':_0x3d8571['options']?_0x3d8571[_0x43f7('0x19')][_0x43f7('0x1c')]||null:null,'limit':_0x3d8571[_0x43f7('0x19')]?_0x3d8571[_0x43f7('0x19')][_0x43f7('0x1d')]||null:null,'include':_0x3d8571[_0x43f7('0x19')]?_0x3d8571[_0x43f7('0x19')][_0x43f7('0x1e')]?_[_0x43f7('0x1f')](_0x3d8571[_0x43f7('0x19')][_0x43f7('0x1e')],function(_0x4e6e98){return{'model':db[_0x4e6e98[_0x43f7('0x20')]],'as':_0x4e6e98['as'],'attributes':_0x4e6e98[_0x43f7('0x1c')],'include':_0x4e6e98[_0x43f7('0x1e')]?_[_0x43f7('0x1f')](_0x4e6e98['include'],function(_0x2d7b3a){return{'model':db[_0x2d7b3a['model']],'as':_0x2d7b3a['as'],'attributes':_0x2d7b3a[_0x43f7('0x1c')],'include':_0x2d7b3a[_0x43f7('0x1e')]?_[_0x43f7('0x1f')](_0x2d7b3a[_0x43f7('0x1e')],function(_0x339775){return{'model':db[_0x339775[_0x43f7('0x20')]],'as':_0x339775['as'],'attributes':_0x339775[_0x43f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x43f7('0xc')](function(_0x1d3ee5){logger[_0x43f7('0x13')](_0x43f7('0x21'),_0x3d8571);logger[_0x43f7('0xe')]('GetZohoAccount',_0x3d8571,JSON[_0x43f7('0x10')](_0x1d3ee5));_0x44380f(_0x1d3ee5);})[_0x43f7('0x16')](function(_0x16f48c){logger[_0x43f7('0x11')](_0x43f7('0x21'),_0x16f48c['message'],_0x3d8571);_0x8c976a(_0x5ce4ed[_0x43f7('0x11')](0x1f4,_0x16f48c['message']));});});};exports['ShowZohoAccount']=function(_0xb0f888){var _0x1b9ca5=this;return new Promise(function(_0x5dd95a,_0x490561){return db[_0x43f7('0x17')][_0x43f7('0x22')]({'raw':_0xb0f888[_0x43f7('0x19')]?_0xb0f888[_0x43f7('0x19')][_0x43f7('0x1a')]===undefined?!![]:![]:!![],'where':_0xb0f888[_0x43f7('0x19')]?_0xb0f888[_0x43f7('0x19')]['where']||null:null,'attributes':_0xb0f888[_0x43f7('0x19')]?_0xb0f888[_0x43f7('0x19')][_0x43f7('0x1c')]||null:null,'include':_0xb0f888[_0x43f7('0x19')]?_0xb0f888[_0x43f7('0x19')][_0x43f7('0x1e')]?_['map'](_0xb0f888[_0x43f7('0x19')][_0x43f7('0x1e')],function(_0x3fab91){return{'model':db[_0x3fab91[_0x43f7('0x20')]],'as':_0x3fab91['as'],'attributes':_0x3fab91[_0x43f7('0x1c')],'include':_0x3fab91[_0x43f7('0x1e')]?_[_0x43f7('0x1f')](_0x3fab91['include'],function(_0x25c521){return{'model':db[_0x25c521[_0x43f7('0x20')]],'as':_0x25c521['as'],'attributes':_0x25c521['attributes'],'include':_0x25c521['include']?_['map'](_0x25c521[_0x43f7('0x1e')],function(_0x4c48ad){return{'model':db[_0x4c48ad[_0x43f7('0x20')]],'as':_0x4c48ad['as'],'attributes':_0x4c48ad[_0x43f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x43f7('0xc')](function(_0x38e52a){logger['info'](_0x43f7('0x23'),_0xb0f888);logger[_0x43f7('0xe')](_0x43f7('0x23'),_0xb0f888,JSON[_0x43f7('0x10')](_0x38e52a));_0x5dd95a(_0x38e52a);})[_0x43f7('0x16')](function(_0x3fe7b9){logger[_0x43f7('0x11')](_0x43f7('0x23'),_0x3fe7b9[_0x43f7('0x12')],_0xb0f888);_0x490561(_0x1b9ca5[_0x43f7('0x11')](0x1f4,_0x3fe7b9[_0x43f7('0x12')]));});});};
\ No newline at end of file