b42b74f0956b9a489907eccc66b607dcfa5be9af
[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 _0x295d=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x4c844d,_0x3ac798){var _0x38488a=function(_0x3699ad){while(--_0x3699ad){_0x4c844d['push'](_0x4c844d['shift']());}};_0x38488a(++_0x3ac798);}(_0x295d,0x15c));var _0xd295=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x295d[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xd295('0x0'));var util=require(_0xd295('0x1'));var moment=require(_0xd295('0x2'));var BPromise=require(_0xd295('0x3'));var rs=require(_0xd295('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd295('0x5'));var logger=require(_0xd295('0x6'))(_0xd295('0x7'));var config=require(_0xd295('0x8'));var jayson=require(_0xd295('0x9'));var client=jayson['client'][_0xd295('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52c2f0,_0x379bbc,_0x5a4a9d){return new BPromise(function(_0x2c7ef2,_0x5e8354){return client[_0xd295('0xb')](_0x52c2f0,_0x5a4a9d)[_0xd295('0xc')](function(_0x424308){logger[_0xd295('0xd')](_0xd295('0xe'),_0x379bbc,_0xd295('0xf'));logger[_0xd295('0x10')](_0xd295('0x11'),_0x379bbc,_0xd295('0xf'),JSON[_0xd295('0x12')](_0x424308));if(_0x424308[_0xd295('0x13')]){if(_0x424308['error'][_0xd295('0x14')]===0x1f4){logger[_0xd295('0x13')](_0xd295('0xe'),_0x379bbc,_0x424308[_0xd295('0x13')][_0xd295('0x15')]);return _0x5e8354(_0x424308[_0xd295('0x13')][_0xd295('0x15')]);}logger['error'](_0xd295('0xe'),_0x379bbc,_0x424308[_0xd295('0x13')]['message']);return _0x2c7ef2(_0x424308[_0xd295('0x13')][_0xd295('0x15')]);}else{logger[_0xd295('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x379bbc,_0xd295('0xf'));_0x2c7ef2(_0x424308[_0xd295('0x16')][_0xd295('0x15')]);}})[_0xd295('0x17')](function(_0x2d5f0e){logger[_0xd295('0x13')](_0xd295('0xe'),_0x379bbc,_0x2d5f0e);_0x5e8354(_0x2d5f0e);});});}