Built motion from commit (unavailable).|2.4.21
[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 _0xf39f=['../../config/utils','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf39f,0xb0));var _0xff39=function(_0x70fb04,_0x20c553){_0x70fb04=_0x70fb04-0x0;var _0x23e505=_0xf39f[_0x70fb04];return _0x23e505;};'use strict';var _=require('lodash');var util=require(_0xff39('0x0'));var moment=require(_0xff39('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff39('0x2'));var db=require(_0xff39('0x3'))['db'];var utils=require(_0xff39('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xff39('0x5'));var jayson=require(_0xff39('0x6'));var client=jayson[_0xff39('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1622fe,_0x452077,_0x4bee80){return new BPromise(function(_0x1fd6b9,_0x2b54c7){return client[_0xff39('0x8')](_0x1622fe,_0x4bee80)[_0xff39('0x9')](function(_0x27c2f5){logger[_0xff39('0xa')](_0xff39('0xb'),_0x452077,_0xff39('0xc'));logger[_0xff39('0xd')](_0xff39('0xe'),_0x452077,_0xff39('0xc'),JSON[_0xff39('0xf')](_0x27c2f5));if(_0x27c2f5['error']){if(_0x27c2f5[_0xff39('0x10')]['code']===0x1f4){logger['error'](_0xff39('0xb'),_0x452077,_0x27c2f5[_0xff39('0x10')][_0xff39('0x11')]);return _0x2b54c7(_0x27c2f5['error'][_0xff39('0x11')]);}logger[_0xff39('0x10')](_0xff39('0xb'),_0x452077,_0x27c2f5[_0xff39('0x10')]['message']);return _0x1fd6b9(_0x27c2f5[_0xff39('0x10')]['message']);}else{logger[_0xff39('0xa')](_0xff39('0xb'),_0x452077,_0xff39('0xc'));_0x1fd6b9(_0x27c2f5[_0xff39('0x12')][_0xff39('0x11')]);}})[_0xff39('0x13')](function(_0x20dd9f){logger['error'](_0xff39('0xb'),_0x452077,_0x20dd9f);_0x2b54c7(_0x20dd9f);});});}