d706746944aa627deed66e08e0c48e2c33e10496
[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 _0xe21b=['error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x89ea08,_0x138278){var _0x325db2=function(_0xd7da8d){while(--_0xd7da8d){_0x89ea08['push'](_0x89ea08['shift']());}};_0x325db2(++_0x138278);}(_0xe21b,0x88));var _0xbe21=function(_0x8dd585,_0x40d5c4){_0x8dd585=_0x8dd585-0x0;var _0x36bcd6=_0xe21b[_0x8dd585];return _0x36bcd6;};'use strict';var _=require(_0xbe21('0x0'));var util=require(_0xbe21('0x1'));var moment=require(_0xbe21('0x2'));var BPromise=require(_0xbe21('0x3'));var rs=require(_0xbe21('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe21('0x5'))(_0xbe21('0x6'));var config=require(_0xbe21('0x7'));var jayson=require(_0xbe21('0x8'));var client=jayson['client'][_0xbe21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x415439,_0x427e47,_0x2c1643){return new BPromise(function(_0x515dd2,_0x4199aa){return client[_0xbe21('0xa')](_0x415439,_0x2c1643)[_0xbe21('0xb')](function(_0x8a6b00){logger[_0xbe21('0xc')](_0xbe21('0xd'),_0x427e47,_0xbe21('0xe'));logger[_0xbe21('0xf')](_0xbe21('0x10'),_0x427e47,_0xbe21('0xe'),JSON[_0xbe21('0x11')](_0x8a6b00));if(_0x8a6b00[_0xbe21('0x12')]){if(_0x8a6b00['error'][_0xbe21('0x13')]===0x1f4){logger[_0xbe21('0x12')](_0xbe21('0xd'),_0x427e47,_0x8a6b00[_0xbe21('0x12')][_0xbe21('0x14')]);return _0x4199aa(_0x8a6b00['error'][_0xbe21('0x14')]);}logger[_0xbe21('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x427e47,_0x8a6b00[_0xbe21('0x12')][_0xbe21('0x14')]);return _0x515dd2(_0x8a6b00[_0xbe21('0x12')][_0xbe21('0x14')]);}else{logger[_0xbe21('0xc')](_0xbe21('0xd'),_0x427e47,_0xbe21('0xe'));_0x515dd2(_0x8a6b00[_0xbe21('0x15')][_0xbe21('0x14')]);}})['catch'](function(_0x46bade){logger[_0xbe21('0x12')](_0xbe21('0xd'),_0x427e47,_0x46bade);_0x4199aa(_0x46bade);});});}