Built motion from commit (unavailable).|2.4.20
[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 _0x8580=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x2613bf,_0x2bdf02){var _0x1ddbc2=function(_0x5c2178){while(--_0x5c2178){_0x2613bf['push'](_0x2613bf['shift']());}};_0x1ddbc2(++_0x2bdf02);}(_0x8580,0x1bf));var _0x0858=function(_0xcde78c,_0x186056){_0xcde78c=_0xcde78c-0x0;var _0x19a3ab=_0x8580[_0xcde78c];return _0x19a3ab;};'use strict';var _=require(_0x0858('0x0'));var util=require(_0x0858('0x1'));var moment=require(_0x0858('0x2'));var BPromise=require(_0x0858('0x3'));var rs=require(_0x0858('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x5'))['db'];var utils=require(_0x0858('0x6'));var logger=require(_0x0858('0x7'))(_0x0858('0x8'));var config=require(_0x0858('0x9'));var jayson=require(_0x0858('0xa'));var client=jayson['client'][_0x0858('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22b763,_0x2d1d65,_0x3bcfe1){return new BPromise(function(_0x2a7074,_0x520b10){return client['request'](_0x22b763,_0x3bcfe1)[_0x0858('0xc')](function(_0x33386b){logger[_0x0858('0xd')](_0x0858('0xe'),_0x2d1d65,_0x0858('0xf'));logger[_0x0858('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2d1d65,'request\x20sent',JSON[_0x0858('0x11')](_0x33386b));if(_0x33386b[_0x0858('0x12')]){if(_0x33386b['error'][_0x0858('0x13')]===0x1f4){logger[_0x0858('0x12')](_0x0858('0xe'),_0x2d1d65,_0x33386b[_0x0858('0x12')][_0x0858('0x14')]);return _0x520b10(_0x33386b[_0x0858('0x12')]['message']);}logger[_0x0858('0x12')](_0x0858('0xe'),_0x2d1d65,_0x33386b[_0x0858('0x12')][_0x0858('0x14')]);return _0x2a7074(_0x33386b[_0x0858('0x12')][_0x0858('0x14')]);}else{logger[_0x0858('0xd')](_0x0858('0xe'),_0x2d1d65,_0x0858('0xf'));_0x2a7074(_0x33386b[_0x0858('0x15')][_0x0858('0x14')]);}})[_0x0858('0x16')](function(_0x34f77f){logger[_0x0858('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d1d65,_0x34f77f);_0x520b10(_0x34f77f);});});}