cc605a3d71ef5b8d9e6d696960ef3038acc08bd2
[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 _0x804e=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2dec67,_0x328cc3){var _0x1f4f47=function(_0x3f12d9){while(--_0x3f12d9){_0x2dec67['push'](_0x2dec67['shift']());}};_0x1f4f47(++_0x328cc3);}(_0x804e,0x1b4));var _0xe804=function(_0x5aab79,_0x2c285c){_0x5aab79=_0x5aab79-0x0;var _0x355002=_0x804e[_0x5aab79];return _0x355002;};'use strict';var _=require(_0xe804('0x0'));var util=require('util');var moment=require(_0xe804('0x1'));var BPromise=require(_0xe804('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe804('0x3'));var db=require(_0xe804('0x4'))['db'];var utils=require(_0xe804('0x5'));var logger=require(_0xe804('0x6'))(_0xe804('0x7'));var config=require(_0xe804('0x8'));var jayson=require(_0xe804('0x9'));var client=jayson[_0xe804('0xa')][_0xe804('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f1485,_0xad05e0,_0x17fb6f){return new BPromise(function(_0x1a50c0,_0x18cac3){return client[_0xe804('0xc')](_0x4f1485,_0x17fb6f)[_0xe804('0xd')](function(_0x1076b5){logger[_0xe804('0xe')](_0xe804('0xf'),_0xad05e0,_0xe804('0x10'));logger[_0xe804('0x11')](_0xe804('0x12'),_0xad05e0,'request\x20sent',JSON[_0xe804('0x13')](_0x1076b5));if(_0x1076b5['error']){if(_0x1076b5['error'][_0xe804('0x14')]===0x1f4){logger[_0xe804('0x15')](_0xe804('0xf'),_0xad05e0,_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);return _0x18cac3(_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);}logger[_0xe804('0x15')](_0xe804('0xf'),_0xad05e0,_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);return _0x1a50c0(_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);}else{logger[_0xe804('0xe')](_0xe804('0xf'),_0xad05e0,_0xe804('0x10'));_0x1a50c0(_0x1076b5[_0xe804('0x17')][_0xe804('0x16')]);}})[_0xe804('0x18')](function(_0x35a30b){logger[_0xe804('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0xad05e0,_0x35a30b);_0x18cac3(_0x35a30b);});});}