Built motion from commit (unavailable).|2.5.0
[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 _0x489e=['info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x541454,_0xded78c){var _0x4e5272=function(_0x3e58d5){while(--_0x3e58d5){_0x541454['push'](_0x541454['shift']());}};_0x4e5272(++_0xded78c);}(_0x489e,0x1c1));var _0xe489=function(_0x3a1bd2,_0x25ccca){_0x3a1bd2=_0x3a1bd2-0x0;var _0x201f79=_0x489e[_0x3a1bd2];return _0x201f79;};'use strict';var _=require(_0xe489('0x0'));var util=require(_0xe489('0x1'));var moment=require(_0xe489('0x2'));var BPromise=require('bluebird');var rs=require(_0xe489('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe489('0x4'));var logger=require(_0xe489('0x5'))(_0xe489('0x6'));var config=require(_0xe489('0x7'));var jayson=require(_0xe489('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x54161e,_0x4569f9,_0x3e6c13){return new BPromise(function(_0xcaaf77,_0x5c482c){return client[_0xe489('0x9')](_0x54161e,_0x3e6c13)[_0xe489('0xa')](function(_0x4d567b){logger[_0xe489('0xb')](_0xe489('0xc'),_0x4569f9,'request\x20sent');logger[_0xe489('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4569f9,_0xe489('0xe'),JSON[_0xe489('0xf')](_0x4d567b));if(_0x4d567b[_0xe489('0x10')]){if(_0x4d567b[_0xe489('0x10')][_0xe489('0x11')]===0x1f4){logger[_0xe489('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x4569f9,_0x4d567b[_0xe489('0x10')][_0xe489('0x12')]);return _0x5c482c(_0x4d567b[_0xe489('0x10')][_0xe489('0x12')]);}logger['error'](_0xe489('0xc'),_0x4569f9,_0x4d567b[_0xe489('0x10')][_0xe489('0x12')]);return _0xcaaf77(_0x4d567b[_0xe489('0x10')][_0xe489('0x12')]);}else{logger[_0xe489('0xb')](_0xe489('0xc'),_0x4569f9,'request\x20sent');_0xcaaf77(_0x4d567b['result'][_0xe489('0x12')]);}})[_0xe489('0x13')](function(_0x392e5b){logger[_0xe489('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x4569f9,_0x392e5b);_0x5c482c(_0x392e5b);});});}