88fae6bdfacdbab79271cae26d7990929e00bdc0
[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 _0xff09=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4df85c,_0x248dfb){var _0x4e2a61=function(_0x4e2c8e){while(--_0x4e2c8e){_0x4df85c['push'](_0x4df85c['shift']());}};_0x4e2a61(++_0x248dfb);}(_0xff09,0x1e6));var _0x9ff0=function(_0xd75c6f,_0x4906a3){_0xd75c6f=_0xd75c6f-0x0;var _0xe1d49e=_0xff09[_0xd75c6f];return _0xe1d49e;};'use strict';var _=require(_0x9ff0('0x0'));var util=require('util');var moment=require(_0x9ff0('0x1'));var BPromise=require(_0x9ff0('0x2'));var rs=require(_0x9ff0('0x3'));var fs=require('fs');var Redis=require(_0x9ff0('0x4'));var db=require(_0x9ff0('0x5'))['db'];var utils=require(_0x9ff0('0x6'));var logger=require(_0x9ff0('0x7'))('rpc');var config=require(_0x9ff0('0x8'));var jayson=require(_0x9ff0('0x9'));var client=jayson[_0x9ff0('0xa')][_0x9ff0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x452f77,_0x272477,_0x112b5e){return new BPromise(function(_0xaff3af,_0x2aaf18){return client[_0x9ff0('0xc')](_0x452f77,_0x112b5e)[_0x9ff0('0xd')](function(_0x1b414c){logger[_0x9ff0('0xe')](_0x9ff0('0xf'),_0x272477,_0x9ff0('0x10'));logger[_0x9ff0('0x11')](_0x9ff0('0x12'),_0x272477,_0x9ff0('0x10'),JSON[_0x9ff0('0x13')](_0x1b414c));if(_0x1b414c[_0x9ff0('0x14')]){if(_0x1b414c[_0x9ff0('0x14')][_0x9ff0('0x15')]===0x1f4){logger['error'](_0x9ff0('0xf'),_0x272477,_0x1b414c[_0x9ff0('0x14')][_0x9ff0('0x16')]);return _0x2aaf18(_0x1b414c[_0x9ff0('0x14')][_0x9ff0('0x16')]);}logger[_0x9ff0('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x272477,_0x1b414c[_0x9ff0('0x14')][_0x9ff0('0x16')]);return _0xaff3af(_0x1b414c[_0x9ff0('0x14')][_0x9ff0('0x16')]);}else{logger[_0x9ff0('0xe')](_0x9ff0('0xf'),_0x272477,_0x9ff0('0x10'));_0xaff3af(_0x1b414c[_0x9ff0('0x17')]['message']);}})['catch'](function(_0x1e5111){logger[_0x9ff0('0x14')](_0x9ff0('0xf'),_0x272477,_0x1e5111);_0x2aaf18(_0x1e5111);});});}