Built motion from commit 3c2ce842.|2.6.31
[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 _0x5278=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x3d5d16,_0x4cf444){var _0x442a4d=function(_0x4712c0){while(--_0x4712c0){_0x3d5d16['push'](_0x3d5d16['shift']());}};_0x442a4d(++_0x4cf444);}(_0x5278,0x166));var _0x8527=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x5278[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x8527('0x0'));var util=require(_0x8527('0x1'));var moment=require(_0x8527('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8527('0x3'));var db=require(_0x8527('0x4'))['db'];var utils=require(_0x8527('0x5'));var logger=require('../../config/logger')(_0x8527('0x6'));var config=require(_0x8527('0x7'));var jayson=require(_0x8527('0x8'));var client=jayson['client'][_0x8527('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x195055,_0x345408,_0x365a4a){return new BPromise(function(_0x1e7640,_0x269a68){return client[_0x8527('0xa')](_0x195055,_0x365a4a)['then'](function(_0x36689e){logger[_0x8527('0xb')](_0x8527('0xc'),_0x345408,'request\x20sent');logger['debug'](_0x8527('0xd'),_0x345408,_0x8527('0xe'),JSON[_0x8527('0xf')](_0x36689e));if(_0x36689e[_0x8527('0x10')]){if(_0x36689e[_0x8527('0x10')]['code']===0x1f4){logger[_0x8527('0x10')](_0x8527('0xc'),_0x345408,_0x36689e[_0x8527('0x10')][_0x8527('0x11')]);return _0x269a68(_0x36689e[_0x8527('0x10')][_0x8527('0x11')]);}logger[_0x8527('0x10')](_0x8527('0xc'),_0x345408,_0x36689e[_0x8527('0x10')][_0x8527('0x11')]);return _0x1e7640(_0x36689e[_0x8527('0x10')][_0x8527('0x11')]);}else{logger[_0x8527('0xb')](_0x8527('0xc'),_0x345408,_0x8527('0xe'));_0x1e7640(_0x36689e[_0x8527('0x12')][_0x8527('0x11')]);}})[_0x8527('0x13')](function(_0x270988){logger[_0x8527('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x345408,_0x270988);_0x269a68(_0x270988);});});}