Built motion from commit 9d1906d1.|2.5.40
[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 _0x10ce=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x10ce,0x9e));var _0xe10c=function(_0x3c1e24,_0x13cc5e){_0x3c1e24=_0x3c1e24-0x0;var _0x128a2e=_0x10ce[_0x3c1e24];return _0x128a2e;};'use strict';var _=require('lodash');var util=require(_0xe10c('0x0'));var moment=require(_0xe10c('0x1'));var BPromise=require('bluebird');var rs=require(_0xe10c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe10c('0x3'))['db'];var utils=require(_0xe10c('0x4'));var logger=require('../../config/logger')(_0xe10c('0x5'));var config=require(_0xe10c('0x6'));var jayson=require(_0xe10c('0x7'));var client=jayson[_0xe10c('0x8')][_0xe10c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b4045,_0x55d88d,_0x1157f5){return new BPromise(function(_0x522f60,_0xb8546c){return client[_0xe10c('0xa')](_0x4b4045,_0x1157f5)[_0xe10c('0xb')](function(_0x173391){logger[_0xe10c('0xc')](_0xe10c('0xd'),_0x55d88d,_0xe10c('0xe'));logger[_0xe10c('0xf')](_0xe10c('0x10'),_0x55d88d,_0xe10c('0xe'),JSON[_0xe10c('0x11')](_0x173391));if(_0x173391[_0xe10c('0x12')]){if(_0x173391[_0xe10c('0x12')][_0xe10c('0x13')]===0x1f4){logger['error'](_0xe10c('0xd'),_0x55d88d,_0x173391[_0xe10c('0x12')][_0xe10c('0x14')]);return _0xb8546c(_0x173391['error'][_0xe10c('0x14')]);}logger[_0xe10c('0x12')](_0xe10c('0xd'),_0x55d88d,_0x173391[_0xe10c('0x12')][_0xe10c('0x14')]);return _0x522f60(_0x173391[_0xe10c('0x12')][_0xe10c('0x14')]);}else{logger['info'](_0xe10c('0xd'),_0x55d88d,_0xe10c('0xe'));_0x522f60(_0x173391[_0xe10c('0x15')][_0xe10c('0x14')]);}})[_0xe10c('0x16')](function(_0x2c9475){logger[_0xe10c('0x12')](_0xe10c('0xd'),_0x55d88d,_0x2c9475);_0xb8546c(_0x2c9475);});});}