Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / intZohoAccount / intZohoAccount.rpc.js
index e63f649..ad6f4d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6372=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','ZohoAccount','findAll','options','raw','attributes','include','map','model','GetZohoAccount','ShowZohoAccount','find','where','lodash','moment'];(function(_0x5da21c,_0x340f8b){var _0x3b72fa=function(_0x3aae43){while(--_0x3aae43){_0x5da21c['push'](_0x5da21c['shift']());}};_0x3b72fa(++_0x340f8b);}(_0x6372,0x1b8));var _0x2637=function(_0x2cc3c1,_0xa43650){_0x2cc3c1=_0x2cc3c1-0x0;var _0x4c4f66=_0x6372[_0x2cc3c1];return _0x4c4f66;};'use strict';var _=require(_0x2637('0x0'));var util=require('util');var moment=require(_0x2637('0x1'));var BPromise=require('bluebird');var rs=require(_0x2637('0x2'));var fs=require('fs');var Redis=require(_0x2637('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2637('0x4'));var logger=require(_0x2637('0x5'))(_0x2637('0x6'));var config=require(_0x2637('0x7'));var jayson=require(_0x2637('0x8'));var client=jayson['client'][_0x2637('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54bdd1,_0x4f8521,_0x49383d){return new BPromise(function(_0x30abde,_0x5a4748){return client['request'](_0x54bdd1,_0x49383d)[_0x2637('0xa')](function(_0x2dbcb5){logger[_0x2637('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x4f8521,'request\x20sent');logger[_0x2637('0xc')](_0x2637('0xd'),_0x4f8521,_0x2637('0xe'),JSON[_0x2637('0xf')](_0x2dbcb5));if(_0x2dbcb5[_0x2637('0x10')]){if(_0x2dbcb5[_0x2637('0x10')][_0x2637('0x11')]===0x1f4){logger[_0x2637('0x10')](_0x2637('0x12'),_0x4f8521,_0x2dbcb5['error'][_0x2637('0x13')]);return _0x5a4748(_0x2dbcb5[_0x2637('0x10')][_0x2637('0x13')]);}logger['error'](_0x2637('0x12'),_0x4f8521,_0x2dbcb5[_0x2637('0x10')][_0x2637('0x13')]);return _0x30abde(_0x2dbcb5[_0x2637('0x10')]['message']);}else{logger[_0x2637('0xb')](_0x2637('0x12'),_0x4f8521,_0x2637('0xe'));_0x30abde(_0x2dbcb5[_0x2637('0x14')][_0x2637('0x13')]);}})[_0x2637('0x15')](function(_0x567d3c){logger['error'](_0x2637('0x12'),_0x4f8521,_0x567d3c);_0x5a4748(_0x567d3c);});});}exports['GetZohoAccount']=function(_0x4f44d7){var _0x3dcb2e=this;return new Promise(function(_0x1e9598,_0x4d3266){return db[_0x2637('0x16')][_0x2637('0x17')]({'raw':_0x4f44d7[_0x2637('0x18')]?_0x4f44d7['options'][_0x2637('0x19')]===undefined?!![]:![]:!![],'where':_0x4f44d7[_0x2637('0x18')]?_0x4f44d7[_0x2637('0x18')]['where']||null:null,'attributes':_0x4f44d7[_0x2637('0x18')]?_0x4f44d7[_0x2637('0x18')][_0x2637('0x1a')]||null:null,'limit':_0x4f44d7['options']?_0x4f44d7[_0x2637('0x18')]['limit']||null:null,'include':_0x4f44d7[_0x2637('0x18')]?_0x4f44d7[_0x2637('0x18')][_0x2637('0x1b')]?_['map'](_0x4f44d7['options'][_0x2637('0x1b')],function(_0x5e6d31){return{'model':db[_0x5e6d31['model']],'as':_0x5e6d31['as'],'attributes':_0x5e6d31['attributes'],'include':_0x5e6d31[_0x2637('0x1b')]?_[_0x2637('0x1c')](_0x5e6d31[_0x2637('0x1b')],function(_0x3d3bd9){return{'model':db[_0x3d3bd9[_0x2637('0x1d')]],'as':_0x3d3bd9['as'],'attributes':_0x3d3bd9[_0x2637('0x1a')],'include':_0x3d3bd9[_0x2637('0x1b')]?_[_0x2637('0x1c')](_0x3d3bd9['include'],function(_0x13a4a8){return{'model':db[_0x13a4a8[_0x2637('0x1d')]],'as':_0x13a4a8['as'],'attributes':_0x13a4a8['attributes']};}):[]};}):[]};}):[]:[]})[_0x2637('0xa')](function(_0x2d3f28){logger[_0x2637('0xb')](_0x2637('0x1e'),_0x4f44d7);logger['debug'](_0x2637('0x1e'),_0x4f44d7,JSON[_0x2637('0xf')](_0x2d3f28));_0x1e9598(_0x2d3f28);})[_0x2637('0x15')](function(_0x27f326){logger[_0x2637('0x10')]('GetZohoAccount',_0x27f326['message'],_0x4f44d7);_0x4d3266(_0x3dcb2e[_0x2637('0x10')](0x1f4,_0x27f326['message']));});});};exports[_0x2637('0x1f')]=function(_0xaa5292){var _0x2d1628=this;return new Promise(function(_0x39fd9e,_0x40e343){return db[_0x2637('0x16')][_0x2637('0x20')]({'raw':_0xaa5292[_0x2637('0x18')]?_0xaa5292[_0x2637('0x18')][_0x2637('0x19')]===undefined?!![]:![]:!![],'where':_0xaa5292[_0x2637('0x18')]?_0xaa5292[_0x2637('0x18')][_0x2637('0x21')]||null:null,'attributes':_0xaa5292[_0x2637('0x18')]?_0xaa5292[_0x2637('0x18')][_0x2637('0x1a')]||null:null,'include':_0xaa5292[_0x2637('0x18')]?_0xaa5292['options'][_0x2637('0x1b')]?_[_0x2637('0x1c')](_0xaa5292['options']['include'],function(_0x3b4a0f){return{'model':db[_0x3b4a0f[_0x2637('0x1d')]],'as':_0x3b4a0f['as'],'attributes':_0x3b4a0f[_0x2637('0x1a')],'include':_0x3b4a0f[_0x2637('0x1b')]?_[_0x2637('0x1c')](_0x3b4a0f[_0x2637('0x1b')],function(_0x3107e5){return{'model':db[_0x3107e5[_0x2637('0x1d')]],'as':_0x3107e5['as'],'attributes':_0x3107e5[_0x2637('0x1a')],'include':_0x3107e5[_0x2637('0x1b')]?_[_0x2637('0x1c')](_0x3107e5[_0x2637('0x1b')],function(_0x4bdb3c){return{'model':db[_0x4bdb3c[_0x2637('0x1d')]],'as':_0x4bdb3c['as'],'attributes':_0x4bdb3c['attributes']};}):[]};}):[]};}):[]:[]})[_0x2637('0xa')](function(_0x44b93b){logger[_0x2637('0xb')](_0x2637('0x1f'),_0xaa5292);logger[_0x2637('0xc')](_0x2637('0x1f'),_0xaa5292,JSON[_0x2637('0xf')](_0x44b93b));_0x39fd9e(_0x44b93b);})[_0x2637('0x15')](function(_0x31df33){logger[_0x2637('0x10')](_0x2637('0x1f'),_0x31df33[_0x2637('0x13')],_0xaa5292);_0x40e343(_0x2d1628[_0x2637('0x10')](0x1f4,_0x31df33[_0x2637('0x13')]));});});};
\ No newline at end of file
+var _0xb5fb=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','GetZohoAccount','findAll','options','where','limit','map','include','model','attributes','then','ShowZohoAccount','ZohoAccount','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xd1f099,_0x48a728){var _0x5db86d=function(_0x81c62f){while(--_0x81c62f){_0xd1f099['push'](_0xd1f099['shift']());}};_0x5db86d(++_0x48a728);}(_0xb5fb,0x172));var _0xbb5f=function(_0x7d5b1b,_0x20e692){_0x7d5b1b=_0x7d5b1b-0x0;var _0x51988c=_0xb5fb[_0x7d5b1b];return _0x51988c;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require(_0xbb5f('0xa'));var jayson=require(_0xbb5f('0xb'));var client=jayson[_0xbb5f('0xc')][_0xbb5f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487a1a,_0x597050,_0x317cd9){return new BPromise(function(_0x5e7943,_0x5b91){return client[_0xbb5f('0xe')](_0x487a1a,_0x317cd9)['then'](function(_0x4f13a9){logger[_0xbb5f('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x597050,_0xbb5f('0x10'));logger[_0xbb5f('0x11')](_0xbb5f('0x12'),_0x597050,_0xbb5f('0x10'),JSON[_0xbb5f('0x13')](_0x4f13a9));if(_0x4f13a9[_0xbb5f('0x14')]){if(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x15')]===0x1f4){logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9['error'][_0xbb5f('0x17')]);return _0x5b91(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9[_0xbb5f('0x14')]['message']);return _0x5e7943(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}else{logger[_0xbb5f('0xf')](_0xbb5f('0x16'),_0x597050,'request\x20sent');_0x5e7943(_0x4f13a9['result'][_0xbb5f('0x17')]);}})['catch'](function(_0xdf4ec8){logger[_0xbb5f('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x597050,_0xdf4ec8);_0x5b91(_0xdf4ec8);});});}exports[_0xbb5f('0x18')]=function(_0x4cc050){var _0x313a0e=this;return new Promise(function(_0xca33c1,_0x5944f9){return db['ZohoAccount'][_0xbb5f('0x19')]({'raw':_0x4cc050[_0xbb5f('0x1a')]?_0x4cc050[_0xbb5f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4cc050[_0xbb5f('0x1a')]?_0x4cc050['options'][_0xbb5f('0x1b')]||null:null,'attributes':_0x4cc050[_0xbb5f('0x1a')]?_0x4cc050[_0xbb5f('0x1a')]['attributes']||null:null,'limit':_0x4cc050[_0xbb5f('0x1a')]?_0x4cc050['options'][_0xbb5f('0x1c')]||null:null,'include':_0x4cc050['options']?_0x4cc050[_0xbb5f('0x1a')]['include']?_[_0xbb5f('0x1d')](_0x4cc050['options'][_0xbb5f('0x1e')],function(_0xb35efe){return{'model':db[_0xb35efe[_0xbb5f('0x1f')]],'as':_0xb35efe['as'],'attributes':_0xb35efe['attributes'],'include':_0xb35efe[_0xbb5f('0x1e')]?_['map'](_0xb35efe['include'],function(_0x41be1c){return{'model':db[_0x41be1c[_0xbb5f('0x1f')]],'as':_0x41be1c['as'],'attributes':_0x41be1c[_0xbb5f('0x20')],'include':_0x41be1c[_0xbb5f('0x1e')]?_[_0xbb5f('0x1d')](_0x41be1c[_0xbb5f('0x1e')],function(_0x150e10){return{'model':db[_0x150e10[_0xbb5f('0x1f')]],'as':_0x150e10['as'],'attributes':_0x150e10[_0xbb5f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbb5f('0x21')](function(_0xa87ebb){logger[_0xbb5f('0xf')](_0xbb5f('0x18'),_0x4cc050);logger[_0xbb5f('0x11')](_0xbb5f('0x18'),_0x4cc050,JSON[_0xbb5f('0x13')](_0xa87ebb));_0xca33c1(_0xa87ebb);})['catch'](function(_0x5a2f1a){logger[_0xbb5f('0x14')](_0xbb5f('0x18'),_0x5a2f1a['message'],_0x4cc050);_0x5944f9(_0x313a0e[_0xbb5f('0x14')](0x1f4,_0x5a2f1a['message']));});});};exports[_0xbb5f('0x22')]=function(_0x30641a){var _0xa2adf2=this;return new Promise(function(_0x24e8c2,_0x22d528){return db[_0xbb5f('0x23')]['find']({'raw':_0x30641a[_0xbb5f('0x1a')]?_0x30641a[_0xbb5f('0x1a')][_0xbb5f('0x24')]===undefined?!![]:![]:!![],'where':_0x30641a[_0xbb5f('0x1a')]?_0x30641a[_0xbb5f('0x1a')][_0xbb5f('0x1b')]||null:null,'attributes':_0x30641a[_0xbb5f('0x1a')]?_0x30641a[_0xbb5f('0x1a')][_0xbb5f('0x20')]||null:null,'include':_0x30641a[_0xbb5f('0x1a')]?_0x30641a[_0xbb5f('0x1a')][_0xbb5f('0x1e')]?_['map'](_0x30641a[_0xbb5f('0x1a')][_0xbb5f('0x1e')],function(_0x543b0e){return{'model':db[_0x543b0e[_0xbb5f('0x1f')]],'as':_0x543b0e['as'],'attributes':_0x543b0e['attributes'],'include':_0x543b0e[_0xbb5f('0x1e')]?_['map'](_0x543b0e['include'],function(_0x25c061){return{'model':db[_0x25c061[_0xbb5f('0x1f')]],'as':_0x25c061['as'],'attributes':_0x25c061[_0xbb5f('0x20')],'include':_0x25c061[_0xbb5f('0x1e')]?_[_0xbb5f('0x1d')](_0x25c061[_0xbb5f('0x1e')],function(_0x7769fe){return{'model':db[_0x7769fe[_0xbb5f('0x1f')]],'as':_0x7769fe['as'],'attributes':_0x7769fe[_0xbb5f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbb5f('0x21')](function(_0x2eb51a){logger[_0xbb5f('0xf')](_0xbb5f('0x22'),_0x30641a);logger['debug'](_0xbb5f('0x22'),_0x30641a,JSON[_0xbb5f('0x13')](_0x2eb51a));_0x24e8c2(_0x2eb51a);})[_0xbb5f('0x25')](function(_0x39a895){logger['error'](_0xbb5f('0x22'),_0x39a895['message'],_0x30641a);_0x22d528(_0xa2adf2[_0xbb5f('0x14')](0x1f4,_0x39a895[_0xbb5f('0x17')]));});});};
\ No newline at end of file