Built motion from commit (unavailable).|2.5.26
[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 _0xe230=['bluebird','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','util'];(function(_0x2982fb,_0x5aa7ad){var _0x57bd4f=function(_0x46407c){while(--_0x46407c){_0x2982fb['push'](_0x2982fb['shift']());}};_0x57bd4f(++_0x5aa7ad);}(_0xe230,0x18b));var _0x0e23=function(_0x294458,_0xdeb8ca){_0x294458=_0x294458-0x0;var _0x212dea=_0xe230[_0x294458];return _0x212dea;};'use strict';var _=require('lodash');var util=require(_0x0e23('0x0'));var moment=require('moment');var BPromise=require(_0x0e23('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0e23('0x2'));var config=require(_0x0e23('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x0e23('0x4')][_0x0e23('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x216bcc,_0x40d802,_0x26d324){return new BPromise(function(_0x320e8c,_0x4ad7a7){return client[_0x0e23('0x6')](_0x216bcc,_0x26d324)[_0x0e23('0x7')](function(_0x3c87ac){logger[_0x0e23('0x8')](_0x0e23('0x9'),_0x40d802,'request\x20sent');logger['debug'](_0x0e23('0xa'),_0x40d802,'request\x20sent',JSON[_0x0e23('0xb')](_0x3c87ac));if(_0x3c87ac['error']){if(_0x3c87ac['error'][_0x0e23('0xc')]===0x1f4){logger['error'](_0x0e23('0x9'),_0x40d802,_0x3c87ac[_0x0e23('0xd')]['message']);return _0x4ad7a7(_0x3c87ac[_0x0e23('0xd')]['message']);}logger['error'](_0x0e23('0x9'),_0x40d802,_0x3c87ac[_0x0e23('0xd')]['message']);return _0x320e8c(_0x3c87ac['error'][_0x0e23('0xe')]);}else{logger[_0x0e23('0x8')](_0x0e23('0x9'),_0x40d802,_0x0e23('0xf'));_0x320e8c(_0x3c87ac[_0x0e23('0x10')][_0x0e23('0xe')]);}})[_0x0e23('0x11')](function(_0x2dae9a){logger[_0x0e23('0xd')](_0x0e23('0x9'),_0x40d802,_0x2dae9a);_0x4ad7a7(_0x2dae9a);});});}