Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / intFreshdeskAccount / intFreshdeskAccount.rpc.js
index 7cce2ed..5de3474 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb2a=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','include','model','map','ShowFreshdeskAccount','where','debug','util','moment','bluebird','randomstring'];(function(_0x3d8ca9,_0x4bbb96){var _0x56ab97=function(_0x2ab551){while(--_0x2ab551){_0x3d8ca9['push'](_0x3d8ca9['shift']());}};_0x56ab97(++_0x4bbb96);}(_0xeb2a,0xa6));var _0xaeb2=function(_0x4bad0b,_0x3d3d8b){_0x4bad0b=_0x4bad0b-0x0;var _0x31e074=_0xeb2a[_0x4bad0b];return _0x31e074;};'use strict';var _=require('lodash');var util=require(_0xaeb2('0x0'));var moment=require(_0xaeb2('0x1'));var BPromise=require(_0xaeb2('0x2'));var rs=require(_0xaeb2('0x3'));var fs=require('fs');var Redis=require(_0xaeb2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaeb2('0x5'));var logger=require(_0xaeb2('0x6'))(_0xaeb2('0x7'));var config=require(_0xaeb2('0x8'));var jayson=require(_0xaeb2('0x9'));var client=jayson['client'][_0xaeb2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4800af,_0x31e5b5,_0x2939a8){return new BPromise(function(_0x7a4401,_0x19d40b){return client[_0xaeb2('0xb')](_0x4800af,_0x2939a8)[_0xaeb2('0xc')](function(_0x42776b){logger[_0xaeb2('0xd')](_0xaeb2('0xe'),_0x31e5b5,'request\x20sent');logger['debug'](_0xaeb2('0xf'),_0x31e5b5,_0xaeb2('0x10'),JSON[_0xaeb2('0x11')](_0x42776b));if(_0x42776b['error']){if(_0x42776b[_0xaeb2('0x12')]['code']===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x31e5b5,_0x42776b[_0xaeb2('0x12')][_0xaeb2('0x13')]);return _0x19d40b(_0x42776b['error']['message']);}logger[_0xaeb2('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x31e5b5,_0x42776b[_0xaeb2('0x12')][_0xaeb2('0x13')]);return _0x7a4401(_0x42776b['error'][_0xaeb2('0x13')]);}else{logger[_0xaeb2('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x31e5b5,_0xaeb2('0x10'));_0x7a4401(_0x42776b[_0xaeb2('0x14')]['message']);}})[_0xaeb2('0x15')](function(_0x137b2b){logger[_0xaeb2('0x12')](_0xaeb2('0xe'),_0x31e5b5,_0x137b2b);_0x19d40b(_0x137b2b);});});}exports[_0xaeb2('0x16')]=function(_0x504fb4){var _0x134d1e=this;return new Promise(function(_0x2fa0de,_0x592ee8){return db[_0xaeb2('0x17')][_0xaeb2('0x18')]({'raw':_0x504fb4[_0xaeb2('0x19')]?_0x504fb4[_0xaeb2('0x19')][_0xaeb2('0x1a')]===undefined?!![]:![]:!![],'where':_0x504fb4[_0xaeb2('0x19')]?_0x504fb4[_0xaeb2('0x19')]['where']||null:null,'attributes':_0x504fb4[_0xaeb2('0x19')]?_0x504fb4['options'][_0xaeb2('0x1b')]||null:null,'limit':_0x504fb4[_0xaeb2('0x19')]?_0x504fb4[_0xaeb2('0x19')]['limit']||null:null,'include':_0x504fb4[_0xaeb2('0x19')]?_0x504fb4[_0xaeb2('0x19')][_0xaeb2('0x1c')]?_['map'](_0x504fb4[_0xaeb2('0x19')][_0xaeb2('0x1c')],function(_0x2b7d1a){return{'model':db[_0x2b7d1a[_0xaeb2('0x1d')]],'as':_0x2b7d1a['as'],'attributes':_0x2b7d1a[_0xaeb2('0x1b')],'include':_0x2b7d1a['include']?_[_0xaeb2('0x1e')](_0x2b7d1a[_0xaeb2('0x1c')],function(_0x704d96){return{'model':db[_0x704d96[_0xaeb2('0x1d')]],'as':_0x704d96['as'],'attributes':_0x704d96[_0xaeb2('0x1b')],'include':_0x704d96[_0xaeb2('0x1c')]?_[_0xaeb2('0x1e')](_0x704d96['include'],function(_0x5d675e){return{'model':db[_0x5d675e[_0xaeb2('0x1d')]],'as':_0x5d675e['as'],'attributes':_0x5d675e[_0xaeb2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaeb2('0xc')](function(_0x1e4c2c){logger[_0xaeb2('0xd')]('GetFreshdeskAccount',_0x504fb4);logger['debug'](_0xaeb2('0x16'),_0x504fb4,JSON[_0xaeb2('0x11')](_0x1e4c2c));_0x2fa0de(_0x1e4c2c);})[_0xaeb2('0x15')](function(_0x2d6bdb){logger[_0xaeb2('0x12')]('GetFreshdeskAccount',_0x2d6bdb[_0xaeb2('0x13')],_0x504fb4);_0x592ee8(_0x134d1e[_0xaeb2('0x12')](0x1f4,_0x2d6bdb[_0xaeb2('0x13')]));});});};exports[_0xaeb2('0x1f')]=function(_0x35630e){var _0x13802b=this;return new Promise(function(_0x5384ec,_0xe88d6){return db[_0xaeb2('0x17')]['find']({'raw':_0x35630e['options']?_0x35630e[_0xaeb2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x35630e[_0xaeb2('0x19')]?_0x35630e[_0xaeb2('0x19')][_0xaeb2('0x20')]||null:null,'attributes':_0x35630e[_0xaeb2('0x19')]?_0x35630e['options'][_0xaeb2('0x1b')]||null:null,'include':_0x35630e['options']?_0x35630e[_0xaeb2('0x19')][_0xaeb2('0x1c')]?_[_0xaeb2('0x1e')](_0x35630e[_0xaeb2('0x19')][_0xaeb2('0x1c')],function(_0x497b69){return{'model':db[_0x497b69[_0xaeb2('0x1d')]],'as':_0x497b69['as'],'attributes':_0x497b69[_0xaeb2('0x1b')],'include':_0x497b69[_0xaeb2('0x1c')]?_[_0xaeb2('0x1e')](_0x497b69['include'],function(_0xe30777){return{'model':db[_0xe30777['model']],'as':_0xe30777['as'],'attributes':_0xe30777[_0xaeb2('0x1b')],'include':_0xe30777[_0xaeb2('0x1c')]?_['map'](_0xe30777[_0xaeb2('0x1c')],function(_0x2ea1a5){return{'model':db[_0x2ea1a5['model']],'as':_0x2ea1a5['as'],'attributes':_0x2ea1a5[_0xaeb2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaeb2('0xc')](function(_0x1699dd){logger[_0xaeb2('0xd')]('ShowFreshdeskAccount',_0x35630e);logger[_0xaeb2('0x21')](_0xaeb2('0x1f'),_0x35630e,JSON[_0xaeb2('0x11')](_0x1699dd));_0x5384ec(_0x1699dd);})[_0xaeb2('0x15')](function(_0x24453a){logger['error'](_0xaeb2('0x1f'),_0x24453a[_0xaeb2('0x13')],_0x35630e);_0xe88d6(_0x13802b['error'](0x1f4,_0x24453a['message']));});});};
\ No newline at end of file
+var _0xdffe=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowFreshdeskAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdffe,0x1d2));var _0xedff=function(_0x4491ef,_0x5153d9){_0x4491ef=_0x4491ef-0x0;var _0x3c72dc=_0xdffe[_0x4491ef];return _0x3c72dc;};'use strict';var _=require('lodash');var util=require(_0xedff('0x0'));var moment=require('moment');var BPromise=require(_0xedff('0x1'));var rs=require(_0xedff('0x2'));var fs=require('fs');var Redis=require(_0xedff('0x3'));var db=require(_0xedff('0x4'))['db'];var utils=require(_0xedff('0x5'));var logger=require(_0xedff('0x6'))('rpc');var config=require(_0xedff('0x7'));var jayson=require(_0xedff('0x8'));var client=jayson[_0xedff('0x9')][_0xedff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49f593,_0x18b784,_0x207b40){return new BPromise(function(_0x2b7152,_0x444b34){return client[_0xedff('0xb')](_0x49f593,_0x207b40)[_0xedff('0xc')](function(_0xf506dd){logger[_0xedff('0xd')](_0xedff('0xe'),_0x18b784,_0xedff('0xf'));logger[_0xedff('0x10')](_0xedff('0x11'),_0x18b784,_0xedff('0xf'),JSON[_0xedff('0x12')](_0xf506dd));if(_0xf506dd[_0xedff('0x13')]){if(_0xf506dd[_0xedff('0x13')][_0xedff('0x14')]===0x1f4){logger[_0xedff('0x13')](_0xedff('0xe'),_0x18b784,_0xf506dd['error'][_0xedff('0x15')]);return _0x444b34(_0xf506dd['error']['message']);}logger[_0xedff('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x18b784,_0xf506dd[_0xedff('0x13')][_0xedff('0x15')]);return _0x2b7152(_0xf506dd['error'][_0xedff('0x15')]);}else{logger[_0xedff('0xd')](_0xedff('0xe'),_0x18b784,_0xedff('0xf'));_0x2b7152(_0xf506dd[_0xedff('0x16')][_0xedff('0x15')]);}})[_0xedff('0x17')](function(_0x5321b1){logger['error'](_0xedff('0xe'),_0x18b784,_0x5321b1);_0x444b34(_0x5321b1);});});}exports[_0xedff('0x18')]=function(_0x4a2493){var _0x65352b=this;return new Promise(function(_0x1a5bc6,_0xb1ab24){return db[_0xedff('0x19')][_0xedff('0x1a')]({'raw':_0x4a2493[_0xedff('0x1b')]?_0x4a2493['options'][_0xedff('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a2493[_0xedff('0x1b')]?_0x4a2493[_0xedff('0x1b')][_0xedff('0x1d')]||null:null,'attributes':_0x4a2493[_0xedff('0x1b')]?_0x4a2493[_0xedff('0x1b')][_0xedff('0x1e')]||null:null,'limit':_0x4a2493[_0xedff('0x1b')]?_0x4a2493['options'][_0xedff('0x1f')]||null:null,'include':_0x4a2493[_0xedff('0x1b')]?_0x4a2493['options'][_0xedff('0x20')]?_['map'](_0x4a2493[_0xedff('0x1b')]['include'],function(_0x4a70cf){return{'model':db[_0x4a70cf[_0xedff('0x21')]],'as':_0x4a70cf['as'],'attributes':_0x4a70cf['attributes'],'include':_0x4a70cf[_0xedff('0x20')]?_['map'](_0x4a70cf[_0xedff('0x20')],function(_0xf8896){return{'model':db[_0xf8896[_0xedff('0x21')]],'as':_0xf8896['as'],'attributes':_0xf8896[_0xedff('0x1e')],'include':_0xf8896['include']?_[_0xedff('0x22')](_0xf8896['include'],function(_0x4505bc){return{'model':db[_0x4505bc[_0xedff('0x21')]],'as':_0x4505bc['as'],'attributes':_0x4505bc[_0xedff('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xedff('0xc')](function(_0x4d3275){logger[_0xedff('0xd')](_0xedff('0x18'),_0x4a2493);logger[_0xedff('0x10')](_0xedff('0x18'),_0x4a2493,JSON[_0xedff('0x12')](_0x4d3275));_0x1a5bc6(_0x4d3275);})[_0xedff('0x17')](function(_0x24c986){logger['error']('GetFreshdeskAccount',_0x24c986[_0xedff('0x15')],_0x4a2493);_0xb1ab24(_0x65352b['error'](0x1f4,_0x24c986['message']));});});};exports[_0xedff('0x23')]=function(_0xb070f){var _0x1befd0=this;return new Promise(function(_0x23bb76,_0x21e3fa){return db['FreshdeskAccount'][_0xedff('0x24')]({'raw':_0xb070f[_0xedff('0x1b')]?_0xb070f['options']['raw']===undefined?!![]:![]:!![],'where':_0xb070f[_0xedff('0x1b')]?_0xb070f['options']['where']||null:null,'attributes':_0xb070f[_0xedff('0x1b')]?_0xb070f[_0xedff('0x1b')][_0xedff('0x1e')]||null:null,'include':_0xb070f[_0xedff('0x1b')]?_0xb070f[_0xedff('0x1b')][_0xedff('0x20')]?_[_0xedff('0x22')](_0xb070f[_0xedff('0x1b')][_0xedff('0x20')],function(_0x5ced47){return{'model':db[_0x5ced47[_0xedff('0x21')]],'as':_0x5ced47['as'],'attributes':_0x5ced47[_0xedff('0x1e')],'include':_0x5ced47['include']?_[_0xedff('0x22')](_0x5ced47[_0xedff('0x20')],function(_0x5db980){return{'model':db[_0x5db980[_0xedff('0x21')]],'as':_0x5db980['as'],'attributes':_0x5db980['attributes'],'include':_0x5db980['include']?_['map'](_0x5db980[_0xedff('0x20')],function(_0x811ec){return{'model':db[_0x811ec['model']],'as':_0x811ec['as'],'attributes':_0x811ec[_0xedff('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xedff('0xc')](function(_0x2ded75){logger['info'](_0xedff('0x23'),_0xb070f);logger[_0xedff('0x10')](_0xedff('0x23'),_0xb070f,JSON['stringify'](_0x2ded75));_0x23bb76(_0x2ded75);})[_0xedff('0x17')](function(_0x1fd7ff){logger['error'](_0xedff('0x23'),_0x1fd7ff[_0xedff('0x15')],_0xb070f);_0x21e3fa(_0x1befd0['error'](0x1f4,_0x1fd7ff[_0xedff('0x15')]));});});};
\ No newline at end of file