Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / intZendeskAccount / intZendeskAccount.rpc.js
index 747ef34..0e9d400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2421=['map','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','model','include'];(function(_0x312c7d,_0x5cdb5a){var _0x1d9635=function(_0x4a3078){while(--_0x4a3078){_0x312c7d['push'](_0x312c7d['shift']());}};_0x1d9635(++_0x5cdb5a);}(_0x2421,0x12b));var _0x1242=function(_0x4bf50f,_0x578e28){_0x4bf50f=_0x4bf50f-0x0;var _0x559a54=_0x2421[_0x4bf50f];return _0x559a54;};'use strict';var _=require(_0x1242('0x0'));var util=require(_0x1242('0x1'));var moment=require(_0x1242('0x2'));var BPromise=require(_0x1242('0x3'));var rs=require(_0x1242('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1242('0x5'))['db'];var utils=require(_0x1242('0x6'));var logger=require(_0x1242('0x7'))(_0x1242('0x8'));var config=require(_0x1242('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1242('0xa')][_0x1242('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11d73a,_0xe57b24,_0x40e598){return new BPromise(function(_0x5c5b5a,_0x320f6a){return client[_0x1242('0xc')](_0x11d73a,_0x40e598)[_0x1242('0xd')](function(_0x974707){logger[_0x1242('0xe')](_0x1242('0xf'),_0xe57b24,_0x1242('0x10'));logger[_0x1242('0x11')](_0x1242('0x12'),_0xe57b24,_0x1242('0x10'),JSON[_0x1242('0x13')](_0x974707));if(_0x974707[_0x1242('0x14')]){if(_0x974707[_0x1242('0x14')][_0x1242('0x15')]===0x1f4){logger['error'](_0x1242('0xf'),_0xe57b24,_0x974707[_0x1242('0x14')][_0x1242('0x16')]);return _0x320f6a(_0x974707[_0x1242('0x14')]['message']);}logger[_0x1242('0x14')](_0x1242('0xf'),_0xe57b24,_0x974707['error']['message']);return _0x5c5b5a(_0x974707['error']['message']);}else{logger[_0x1242('0xe')](_0x1242('0xf'),_0xe57b24,_0x1242('0x10'));_0x5c5b5a(_0x974707['result'][_0x1242('0x16')]);}})[_0x1242('0x17')](function(_0x562f79){logger[_0x1242('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0xe57b24,_0x562f79);_0x320f6a(_0x562f79);});});}exports[_0x1242('0x18')]=function(_0x147fd7){var _0x175e6f=this;return new Promise(function(_0x33ee3f,_0x2e2077){return db[_0x1242('0x19')][_0x1242('0x1a')]({'raw':_0x147fd7[_0x1242('0x1b')]?_0x147fd7[_0x1242('0x1b')][_0x1242('0x1c')]===undefined?!![]:![]:!![],'where':_0x147fd7[_0x1242('0x1b')]?_0x147fd7[_0x1242('0x1b')][_0x1242('0x1d')]||null:null,'attributes':_0x147fd7[_0x1242('0x1b')]?_0x147fd7[_0x1242('0x1b')][_0x1242('0x1e')]||null:null,'limit':_0x147fd7[_0x1242('0x1b')]?_0x147fd7['options'][_0x1242('0x1f')]||null:null,'include':_0x147fd7[_0x1242('0x1b')]?_0x147fd7[_0x1242('0x1b')]['include']?_['map'](_0x147fd7[_0x1242('0x1b')]['include'],function(_0x223304){return{'model':db[_0x223304[_0x1242('0x20')]],'as':_0x223304['as'],'attributes':_0x223304[_0x1242('0x1e')],'include':_0x223304[_0x1242('0x21')]?_['map'](_0x223304[_0x1242('0x21')],function(_0x5d3ddb){return{'model':db[_0x5d3ddb[_0x1242('0x20')]],'as':_0x5d3ddb['as'],'attributes':_0x5d3ddb['attributes'],'include':_0x5d3ddb[_0x1242('0x21')]?_[_0x1242('0x22')](_0x5d3ddb[_0x1242('0x21')],function(_0x481add){return{'model':db[_0x481add[_0x1242('0x20')]],'as':_0x481add['as'],'attributes':_0x481add[_0x1242('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1242('0xd')](function(_0x25ccbf){logger[_0x1242('0xe')](_0x1242('0x18'),_0x147fd7);logger['debug'](_0x1242('0x18'),_0x147fd7,JSON['stringify'](_0x25ccbf));_0x33ee3f(_0x25ccbf);})[_0x1242('0x17')](function(_0x4bd388){logger[_0x1242('0x14')](_0x1242('0x18'),_0x4bd388[_0x1242('0x16')],_0x147fd7);_0x2e2077(_0x175e6f[_0x1242('0x14')](0x1f4,_0x4bd388[_0x1242('0x16')]));});});};exports[_0x1242('0x23')]=function(_0x180f42){var _0xeee04a=this;return new Promise(function(_0x2cf4ff,_0x44c9be){return db[_0x1242('0x19')][_0x1242('0x24')]({'raw':_0x180f42['options']?_0x180f42[_0x1242('0x1b')][_0x1242('0x1c')]===undefined?!![]:![]:!![],'where':_0x180f42['options']?_0x180f42[_0x1242('0x1b')][_0x1242('0x1d')]||null:null,'attributes':_0x180f42[_0x1242('0x1b')]?_0x180f42[_0x1242('0x1b')][_0x1242('0x1e')]||null:null,'include':_0x180f42[_0x1242('0x1b')]?_0x180f42['options'][_0x1242('0x21')]?_[_0x1242('0x22')](_0x180f42['options'][_0x1242('0x21')],function(_0x17bdef){return{'model':db[_0x17bdef[_0x1242('0x20')]],'as':_0x17bdef['as'],'attributes':_0x17bdef[_0x1242('0x1e')],'include':_0x17bdef[_0x1242('0x21')]?_[_0x1242('0x22')](_0x17bdef[_0x1242('0x21')],function(_0x3a59bb){return{'model':db[_0x3a59bb['model']],'as':_0x3a59bb['as'],'attributes':_0x3a59bb[_0x1242('0x1e')],'include':_0x3a59bb[_0x1242('0x21')]?_[_0x1242('0x22')](_0x3a59bb[_0x1242('0x21')],function(_0xcca169){return{'model':db[_0xcca169[_0x1242('0x20')]],'as':_0xcca169['as'],'attributes':_0xcca169[_0x1242('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1242('0xd')](function(_0x574f6d){logger[_0x1242('0xe')](_0x1242('0x23'),_0x180f42);logger[_0x1242('0x11')]('ShowZendeskAccount',_0x180f42,JSON[_0x1242('0x13')](_0x574f6d));_0x2cf4ff(_0x574f6d);})[_0x1242('0x17')](function(_0x3a1c11){logger[_0x1242('0x14')](_0x1242('0x23'),_0x3a1c11[_0x1242('0x16')],_0x180f42);_0x44c9be(_0xeee04a['error'](0x1f4,_0x3a1c11[_0x1242('0x16')]));});});};
\ No newline at end of file
+var _0xfb65=['map','model','ShowZendeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetZendeskAccount','ZendeskAccount','findAll','raw','options','where','attributes','include'];(function(_0x27714d,_0x457b53){var _0x18e2fb=function(_0x28f1d9){while(--_0x28f1d9){_0x27714d['push'](_0x27714d['shift']());}};_0x18e2fb(++_0x457b53);}(_0xfb65,0x8c));var _0x5fb6=function(_0x2c2943,_0x385231){_0x2c2943=_0x2c2943-0x0;var _0x23a14f=_0xfb65[_0x2c2943];return _0x23a14f;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var moment=require(_0x5fb6('0x1'));var BPromise=require(_0x5fb6('0x2'));var rs=require(_0x5fb6('0x3'));var fs=require('fs');var Redis=require(_0x5fb6('0x4'));var db=require(_0x5fb6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fb6('0x6'))(_0x5fb6('0x7'));var config=require('../../config/environment');var jayson=require(_0x5fb6('0x8'));var client=jayson[_0x5fb6('0x9')][_0x5fb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d796,_0x3ef4dd,_0x4d142d){return new BPromise(function(_0x2c00c5,_0x502040){return client['request'](_0x56d796,_0x4d142d)[_0x5fb6('0xb')](function(_0x19eeb6){logger[_0x5fb6('0xc')](_0x5fb6('0xd'),_0x3ef4dd,'request\x20sent');logger[_0x5fb6('0xe')](_0x5fb6('0xf'),_0x3ef4dd,'request\x20sent',JSON[_0x5fb6('0x10')](_0x19eeb6));if(_0x19eeb6[_0x5fb6('0x11')]){if(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x12')]===0x1f4){logger[_0x5fb6('0x11')](_0x5fb6('0xd'),_0x3ef4dd,_0x19eeb6['error'][_0x5fb6('0x13')]);return _0x502040(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x13')]);}logger['error'](_0x5fb6('0xd'),_0x3ef4dd,_0x19eeb6['error'][_0x5fb6('0x13')]);return _0x2c00c5(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x13')]);}else{logger[_0x5fb6('0xc')](_0x5fb6('0xd'),_0x3ef4dd,_0x5fb6('0x14'));_0x2c00c5(_0x19eeb6['result'][_0x5fb6('0x13')]);}})[_0x5fb6('0x15')](function(_0x2930a7){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3ef4dd,_0x2930a7);_0x502040(_0x2930a7);});});}exports[_0x5fb6('0x16')]=function(_0x5c06fc){var _0x3b0b87=this;return new Promise(function(_0x47196b,_0x50fc16){return db[_0x5fb6('0x17')][_0x5fb6('0x18')]({'raw':_0x5c06fc['options']?_0x5c06fc['options'][_0x5fb6('0x19')]===undefined?!![]:![]:!![],'where':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1b')]||null:null,'attributes':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1c')]||null:null,'limit':_0x5c06fc['options']?_0x5c06fc[_0x5fb6('0x1a')]['limit']||null:null,'include':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x5c06fc['options'][_0x5fb6('0x1d')],function(_0x47cec9){return{'model':db[_0x47cec9['model']],'as':_0x47cec9['as'],'attributes':_0x47cec9[_0x5fb6('0x1c')],'include':_0x47cec9['include']?_[_0x5fb6('0x1e')](_0x47cec9[_0x5fb6('0x1d')],function(_0x4fa1e0){return{'model':db[_0x4fa1e0[_0x5fb6('0x1f')]],'as':_0x4fa1e0['as'],'attributes':_0x4fa1e0['attributes'],'include':_0x4fa1e0['include']?_[_0x5fb6('0x1e')](_0x4fa1e0[_0x5fb6('0x1d')],function(_0x12701d){return{'model':db[_0x12701d[_0x5fb6('0x1f')]],'as':_0x12701d['as'],'attributes':_0x12701d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fb6('0xb')](function(_0x309bc0){logger[_0x5fb6('0xc')]('GetZendeskAccount',_0x5c06fc);logger[_0x5fb6('0xe')](_0x5fb6('0x16'),_0x5c06fc,JSON[_0x5fb6('0x10')](_0x309bc0));_0x47196b(_0x309bc0);})['catch'](function(_0x68b491){logger[_0x5fb6('0x11')](_0x5fb6('0x16'),_0x68b491['message'],_0x5c06fc);_0x50fc16(_0x3b0b87[_0x5fb6('0x11')](0x1f4,_0x68b491[_0x5fb6('0x13')]));});});};exports[_0x5fb6('0x20')]=function(_0x52ea14){var _0x315b08=this;return new Promise(function(_0x5f27fc,_0x349dd1){return db[_0x5fb6('0x17')][_0x5fb6('0x21')]({'raw':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14['options'][_0x5fb6('0x19')]===undefined?!![]:![]:!![],'where':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1b')]||null:null,'attributes':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1c')]||null:null,'include':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1d')],function(_0x306964){return{'model':db[_0x306964['model']],'as':_0x306964['as'],'attributes':_0x306964['attributes'],'include':_0x306964['include']?_[_0x5fb6('0x1e')](_0x306964['include'],function(_0x251bb7){return{'model':db[_0x251bb7['model']],'as':_0x251bb7['as'],'attributes':_0x251bb7[_0x5fb6('0x1c')],'include':_0x251bb7[_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x251bb7[_0x5fb6('0x1d')],function(_0x51d501){return{'model':db[_0x51d501[_0x5fb6('0x1f')]],'as':_0x51d501['as'],'attributes':_0x51d501[_0x5fb6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34b553){logger[_0x5fb6('0xc')]('ShowZendeskAccount',_0x52ea14);logger[_0x5fb6('0xe')](_0x5fb6('0x20'),_0x52ea14,JSON[_0x5fb6('0x10')](_0x34b553));_0x5f27fc(_0x34b553);})['catch'](function(_0x5bfb54){logger[_0x5fb6('0x11')](_0x5fb6('0x20'),_0x5bfb54[_0x5fb6('0x13')],_0x52ea14);_0x349dd1(_0x315b08['error'](0x1f4,_0x5bfb54[_0x5fb6('0x13')]));});});};
\ No newline at end of file