Built motion from commit 1fa89557.|2.6.10
[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 _0x7488=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x382602,_0x5e9d2d){var _0x14dda6=function(_0xf65c39){while(--_0xf65c39){_0x382602['push'](_0x382602['shift']());}};_0x14dda6(++_0x5e9d2d);}(_0x7488,0x8b));var _0x8748=function(_0x1f1ed0,_0x33d422){_0x1f1ed0=_0x1f1ed0-0x0;var _0x4a85cc=_0x7488[_0x1f1ed0];return _0x4a85cc;};'use strict';var _=require(_0x8748('0x0'));var util=require(_0x8748('0x1'));var moment=require(_0x8748('0x2'));var BPromise=require(_0x8748('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8748('0x4'));var db=require(_0x8748('0x5'))['db'];var utils=require(_0x8748('0x6'));var logger=require(_0x8748('0x7'))(_0x8748('0x8'));var config=require('../../config/environment');var jayson=require(_0x8748('0x9'));var client=jayson[_0x8748('0xa')][_0x8748('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47b196,_0x16d7c0,_0x125ff4){return new BPromise(function(_0x57fc10,_0x55a929){return client[_0x8748('0xc')](_0x47b196,_0x125ff4)[_0x8748('0xd')](function(_0x424f03){logger['info'](_0x8748('0xe'),_0x16d7c0,_0x8748('0xf'));logger[_0x8748('0x10')](_0x8748('0x11'),_0x16d7c0,'request\x20sent',JSON[_0x8748('0x12')](_0x424f03));if(_0x424f03[_0x8748('0x13')]){if(_0x424f03[_0x8748('0x13')]['code']===0x1f4){logger[_0x8748('0x13')](_0x8748('0xe'),_0x16d7c0,_0x424f03['error'][_0x8748('0x14')]);return _0x55a929(_0x424f03[_0x8748('0x13')]['message']);}logger['error'](_0x8748('0xe'),_0x16d7c0,_0x424f03[_0x8748('0x13')][_0x8748('0x14')]);return _0x57fc10(_0x424f03[_0x8748('0x13')][_0x8748('0x14')]);}else{logger[_0x8748('0x15')](_0x8748('0xe'),_0x16d7c0,_0x8748('0xf'));_0x57fc10(_0x424f03[_0x8748('0x16')][_0x8748('0x14')]);}})[_0x8748('0x17')](function(_0x5d1ac7){logger[_0x8748('0x13')](_0x8748('0xe'),_0x16d7c0,_0x5d1ac7);_0x55a929(_0x5d1ac7);});});}