Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index d3f6f6b..5ac28a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51ab=['localhost','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','limit','then','AddTagsToFaxInteraction','find','where','ids','AddTags','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults'];(function(_0x341030,_0x10f8f1){var _0x24bb8e=function(_0x1c6453){while(--_0x1c6453){_0x341030['push'](_0x341030['shift']());}};_0x24bb8e(++_0x10f8f1);}(_0x51ab,0x1ee));var _0xb51a=function(_0x3f7a19,_0x3bae7a){_0x3f7a19=_0x3f7a19-0x0;var _0x10e92e=_0x51ab[_0x3f7a19];return _0x10e92e;};'use strict';var _=require('lodash');var util=require(_0xb51a('0x0'));var moment=require('moment');var BPromise=require(_0xb51a('0x1'));var rs=require(_0xb51a('0x2'));var fs=require('fs');var Redis=require(_0xb51a('0x3'));var db=require(_0xb51a('0x4'))['db'];var utils=require(_0xb51a('0x5'));var logger=require(_0xb51a('0x6'))(_0xb51a('0x7'));var config=require('../../config/environment');var jayson=require(_0xb51a('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb51a('0x9')](config['redis'],{'host':_0xb51a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb51a('0xb'))[_0xb51a('0xc')](socket);function respondWithRpcPromise(_0x2d6fdf,_0x4f8c29,_0x417079){return new BPromise(function(_0x4e31cc,_0x4504be){return client[_0xb51a('0xd')](_0x2d6fdf,_0x417079)['then'](function(_0x1a4887){logger['info'](_0xb51a('0xe'),_0x4f8c29,_0xb51a('0xf'));logger[_0xb51a('0x10')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x4f8c29,_0xb51a('0xf'),JSON[_0xb51a('0x11')](_0x1a4887));if(_0x1a4887[_0xb51a('0x12')]){if(_0x1a4887['error']['code']===0x1f4){logger['error'](_0xb51a('0xe'),_0x4f8c29,_0x1a4887[_0xb51a('0x12')][_0xb51a('0x13')]);return _0x4504be(_0x1a4887[_0xb51a('0x12')][_0xb51a('0x13')]);}logger[_0xb51a('0x12')](_0xb51a('0xe'),_0x4f8c29,_0x1a4887[_0xb51a('0x12')][_0xb51a('0x13')]);return _0x4e31cc(_0x1a4887[_0xb51a('0x12')][_0xb51a('0x13')]);}else{logger[_0xb51a('0x14')](_0xb51a('0xe'),_0x4f8c29,'request\x20sent');_0x4e31cc(_0x1a4887[_0xb51a('0x15')][_0xb51a('0x13')]);}})['catch'](function(_0x509f78){logger[_0xb51a('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x4f8c29,_0x509f78);_0x4504be(_0x509f78);});});}exports[_0xb51a('0x16')]=function(_0x5a802a){var _0xa9b4cb=this;return new Promise(function(_0x4b277d,_0x2e69be){return db[_0xb51a('0x17')][_0xb51a('0x18')](_0x5a802a[_0xb51a('0x19')],{'raw':_0x5a802a[_0xb51a('0x1a')]?_0x5a802a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a802a['options']?_0x5a802a[_0xb51a('0x1a')]['where']||null:null,'attributes':_0x5a802a[_0xb51a('0x1a')]?_0x5a802a[_0xb51a('0x1a')][_0xb51a('0x1b')]||null:null,'limit':_0x5a802a[_0xb51a('0x1a')]?_0x5a802a[_0xb51a('0x1a')][_0xb51a('0x1c')]||null:null})[_0xb51a('0x1d')](function(_0x3f93d4){logger[_0xb51a('0x14')]('UpdateFaxInteraction',_0x5a802a);logger[_0xb51a('0x10')](_0xb51a('0x16'),_0x5a802a,JSON[_0xb51a('0x11')](_0x3f93d4));_0x4b277d(_0x3f93d4);})['catch'](function(_0x5a966d){logger[_0xb51a('0x12')](_0xb51a('0x16'),_0x5a966d['message'],_0x5a802a);_0x2e69be(_0xa9b4cb[_0xb51a('0x12')](0x1f4,_0x5a966d[_0xb51a('0x13')]));});});};exports[_0xb51a('0x1e')]=function(_0x39afb1){return new Promise(function(_0xad470b,_0x5f2a38){return db[_0xb51a('0x17')][_0xb51a('0x1f')]({'where':_0x39afb1[_0xb51a('0x1a')]?_0x39afb1[_0xb51a('0x1a')][_0xb51a('0x20')]||null:null})[_0xb51a('0x1d')](function(_0x57fd21){if(_0x57fd21){return _0x57fd21['addTags'](_0x39afb1[_0xb51a('0x19')][_0xb51a('0x21')],_['omit'](_0x39afb1[_0xb51a('0x19')],[_0xb51a('0x21'),'id'])||{});}})['spread'](function(_0xbff604){logger[_0xb51a('0x14')](_0xb51a('0x22'),_0x39afb1);logger[_0xb51a('0x10')]('AddTags',_0x39afb1,JSON[_0xb51a('0x11')](_0xbff604));_0xad470b(_0xbff604);})[_0xb51a('0x23')](function(_0x234462){logger[_0xb51a('0x12')]('AddTags',_0x234462[_0xb51a('0x13')],_0x39afb1);_0x5f2a38(_this[_0xb51a('0x12')](0x1f4,_0x234462[_0xb51a('0x13')]));});});};
\ No newline at end of file
+var _0xd9fb=['omit','spread','AddTags','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','addTags','ids'];(function(_0x19f9ba,_0x5c2938){var _0x556aef=function(_0x2579da){while(--_0x2579da){_0x19f9ba['push'](_0x19f9ba['shift']());}};_0x556aef(++_0x5c2938);}(_0xd9fb,0x88));var _0xbd9f=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xd9fb[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xbd9f('0x0'));var util=require('util');var moment=require(_0xbd9f('0x1'));var BPromise=require(_0xbd9f('0x2'));var rs=require(_0xbd9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd9f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd9f('0x5'))(_0xbd9f('0x6'));var config=require(_0xbd9f('0x7'));var jayson=require(_0xbd9f('0x8'));var client=jayson[_0xbd9f('0x9')][_0xbd9f('0xa')]({'port':0x232a});config['redis']=_[_0xbd9f('0xb')](config[_0xbd9f('0xc')],{'host':_0xbd9f('0xd'),'port':0x18eb});var socket=require(_0xbd9f('0xe'))(new Redis(config['redis']));require(_0xbd9f('0xf'))[_0xbd9f('0x10')](socket);function respondWithRpcPromise(_0x1e10a8,_0x390b36,_0x6c2e7){return new BPromise(function(_0x5ec584,_0x2f3f80){return client[_0xbd9f('0x11')](_0x1e10a8,_0x6c2e7)[_0xbd9f('0x12')](function(_0x14fe7d){logger[_0xbd9f('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x390b36,_0xbd9f('0x14'));logger[_0xbd9f('0x15')](_0xbd9f('0x16'),_0x390b36,'request\x20sent',JSON['stringify'](_0x14fe7d));if(_0x14fe7d['error']){if(_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x18')]===0x1f4){logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x1a')]);return _0x2f3f80(_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x1a')]);}logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x14fe7d['error'][_0xbd9f('0x1a')]);return _0x5ec584(_0x14fe7d['error'][_0xbd9f('0x1a')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x390b36,_0xbd9f('0x14'));_0x5ec584(_0x14fe7d[_0xbd9f('0x1b')]['message']);}})[_0xbd9f('0x1c')](function(_0x4d28d1){logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x4d28d1);_0x2f3f80(_0x4d28d1);});});}exports['UpdateFaxInteraction']=function(_0x2acca2){var _0x48e637=this;return new Promise(function(_0x29471b,_0x4ddf40){return db['FaxInteraction'][_0xbd9f('0x1d')](_0x2acca2[_0xbd9f('0x1e')],{'raw':_0x2acca2['options']?_0x2acca2[_0xbd9f('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2acca2[_0xbd9f('0x1f')]?_0x2acca2['options'][_0xbd9f('0x20')]||null:null,'attributes':_0x2acca2[_0xbd9f('0x1f')]?_0x2acca2[_0xbd9f('0x1f')][_0xbd9f('0x21')]||null:null,'limit':_0x2acca2['options']?_0x2acca2[_0xbd9f('0x1f')][_0xbd9f('0x22')]||null:null})[_0xbd9f('0x12')](function(_0x75b16b){logger[_0xbd9f('0x13')](_0xbd9f('0x23'),_0x2acca2);logger['debug'](_0xbd9f('0x23'),_0x2acca2,JSON['stringify'](_0x75b16b));_0x29471b(_0x75b16b);})['catch'](function(_0x2f0698){logger[_0xbd9f('0x17')](_0xbd9f('0x23'),_0x2f0698[_0xbd9f('0x1a')],_0x2acca2);_0x4ddf40(_0x48e637['error'](0x1f4,_0x2f0698[_0xbd9f('0x1a')]));});});};exports[_0xbd9f('0x24')]=function(_0x4fb83e){return new Promise(function(_0x470258,_0x36982c){return db[_0xbd9f('0x25')]['find']({'where':_0x4fb83e[_0xbd9f('0x1f')]?_0x4fb83e[_0xbd9f('0x1f')][_0xbd9f('0x20')]||null:null})[_0xbd9f('0x12')](function(_0x1c32fc){if(_0x1c32fc){return _0x1c32fc[_0xbd9f('0x26')](_0x4fb83e[_0xbd9f('0x1e')][_0xbd9f('0x27')],_[_0xbd9f('0x28')](_0x4fb83e[_0xbd9f('0x1e')],[_0xbd9f('0x27'),'id'])||{});}})[_0xbd9f('0x29')](function(_0x56e8bc){logger['info'](_0xbd9f('0x2a'),_0x4fb83e);logger[_0xbd9f('0x15')](_0xbd9f('0x2a'),_0x4fb83e,JSON[_0xbd9f('0x2b')](_0x56e8bc));_0x470258(_0x56e8bc);})[_0xbd9f('0x1c')](function(_0x4ca3a1){logger[_0xbd9f('0x17')](_0xbd9f('0x2a'),_0x4ca3a1['message'],_0x4fb83e);_0x36982c(_this[_0xbd9f('0x17')](0x1f4,_0x4ca3a1[_0xbd9f('0x1a')]));});});};
\ No newline at end of file