d5f12b27581fdc2b55da0580621efd3c54629fa1
[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 _0xa425=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x2d1067,_0x4cc718){var _0x1a99a2=function(_0x24cb31){while(--_0x24cb31){_0x2d1067['push'](_0x2d1067['shift']());}};_0x1a99a2(++_0x4cc718);}(_0xa425,0xbb));var _0x5a42=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0xa425[_0x1d5400];return _0x21d9fe;};'use strict';var _=require(_0x5a42('0x0'));var util=require(_0x5a42('0x1'));var moment=require(_0x5a42('0x2'));var BPromise=require(_0x5a42('0x3'));var rs=require(_0x5a42('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a42('0x5'))['db'];var utils=require(_0x5a42('0x6'));var logger=require(_0x5a42('0x7'))(_0x5a42('0x8'));var config=require('../../config/environment');var jayson=require(_0x5a42('0x9'));var client=jayson['client'][_0x5a42('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110285,_0x16d37e,_0x41b959){return new BPromise(function(_0x5b8fde,_0x4a6759){return client[_0x5a42('0xb')](_0x110285,_0x41b959)[_0x5a42('0xc')](function(_0x154371){logger[_0x5a42('0xd')](_0x5a42('0xe'),_0x16d37e,_0x5a42('0xf'));logger['debug'](_0x5a42('0x10'),_0x16d37e,_0x5a42('0xf'),JSON[_0x5a42('0x11')](_0x154371));if(_0x154371['error']){if(_0x154371[_0x5a42('0x12')][_0x5a42('0x13')]===0x1f4){logger[_0x5a42('0x12')](_0x5a42('0xe'),_0x16d37e,_0x154371[_0x5a42('0x12')][_0x5a42('0x14')]);return _0x4a6759(_0x154371[_0x5a42('0x12')][_0x5a42('0x14')]);}logger[_0x5a42('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x16d37e,_0x154371['error']['message']);return _0x5b8fde(_0x154371[_0x5a42('0x12')]['message']);}else{logger[_0x5a42('0xd')](_0x5a42('0xe'),_0x16d37e,_0x5a42('0xf'));_0x5b8fde(_0x154371['result']['message']);}})[_0x5a42('0x15')](function(_0xfac672){logger[_0x5a42('0x12')](_0x5a42('0xe'),_0x16d37e,_0xfac672);_0x4a6759(_0xfac672);});});}