Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / chatProactiveAction / chatProactiveAction.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xce1b=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xf7b25d,_0x10665e){var _0xa86c65=function(_0x3cef33){while(--_0x3cef33){_0xf7b25d['push'](_0xf7b25d['shift']());}};_0xa86c65(++_0x10665e);}(_0xce1b,0xa2));var _0xbce1=function(_0x23fa79,_0x5cdf24){_0x23fa79=_0x23fa79-0x0;var _0x2594ba=_0xce1b[_0x23fa79];return _0x2594ba;};'use strict';var _=require(_0xbce1('0x0'));var util=require(_0xbce1('0x1'));var moment=require(_0xbce1('0x2'));var BPromise=require(_0xbce1('0x3'));var rs=require(_0xbce1('0x4'));var fs=require('fs');var Redis=require(_0xbce1('0x5'));var db=require(_0xbce1('0x6'))['db'];var utils=require(_0xbce1('0x7'));var logger=require('../../config/logger')(_0xbce1('0x8'));var config=require(_0xbce1('0x9'));var jayson=require(_0xbce1('0xa'));var client=jayson[_0xbce1('0xb')][_0xbce1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47254e,_0x458187,_0xf6c798){return new BPromise(function(_0x472907,_0x4a2ec3){return client[_0xbce1('0xd')](_0x47254e,_0xf6c798)[_0xbce1('0xe')](function(_0x34ec6f){logger[_0xbce1('0xf')](_0xbce1('0x10'),_0x458187,'request\x20sent');logger[_0xbce1('0x11')](_0xbce1('0x12'),_0x458187,_0xbce1('0x13'),JSON['stringify'](_0x34ec6f));if(_0x34ec6f[_0xbce1('0x14')]){if(_0x34ec6f['error'][_0xbce1('0x15')]===0x1f4){logger[_0xbce1('0x14')](_0xbce1('0x10'),_0x458187,_0x34ec6f[_0xbce1('0x14')][_0xbce1('0x16')]);return _0x4a2ec3(_0x34ec6f[_0xbce1('0x14')]['message']);}logger[_0xbce1('0x14')](_0xbce1('0x10'),_0x458187,_0x34ec6f['error'][_0xbce1('0x16')]);return _0x472907(_0x34ec6f[_0xbce1('0x14')]['message']);}else{logger['info'](_0xbce1('0x10'),_0x458187,_0xbce1('0x13'));_0x472907(_0x34ec6f[_0xbce1('0x17')][_0xbce1('0x16')]);}})['catch'](function(_0x4325b9){logger[_0xbce1('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x458187,_0x4325b9);_0x4a2ec3(_0x4325b9);});});}