Built motion from commit fe909640.|2.6.8
[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 _0x26f2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x12f5f7,_0xa58b52){var _0x345c1b=function(_0x306035){while(--_0x306035){_0x12f5f7['push'](_0x12f5f7['shift']());}};_0x345c1b(++_0xa58b52);}(_0x26f2,0x1dc));var _0x226f=function(_0x3848bc,_0x25ff83){_0x3848bc=_0x3848bc-0x0;var _0x334a5a=_0x26f2[_0x3848bc];return _0x334a5a;};'use strict';var _=require('lodash');var util=require(_0x226f('0x0'));var moment=require(_0x226f('0x1'));var BPromise=require(_0x226f('0x2'));var rs=require(_0x226f('0x3'));var fs=require('fs');var Redis=require(_0x226f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x226f('0x5'));var logger=require(_0x226f('0x6'))(_0x226f('0x7'));var config=require(_0x226f('0x8'));var jayson=require(_0x226f('0x9'));var client=jayson[_0x226f('0xa')][_0x226f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37121d,_0x2f37be,_0x21594f){return new BPromise(function(_0x367ce2,_0x15d0a1){return client[_0x226f('0xc')](_0x37121d,_0x21594f)[_0x226f('0xd')](function(_0x451c82){logger[_0x226f('0xe')](_0x226f('0xf'),_0x2f37be,_0x226f('0x10'));logger[_0x226f('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2f37be,_0x226f('0x10'),JSON[_0x226f('0x12')](_0x451c82));if(_0x451c82[_0x226f('0x13')]){if(_0x451c82[_0x226f('0x13')][_0x226f('0x14')]===0x1f4){logger[_0x226f('0x13')](_0x226f('0xf'),_0x2f37be,_0x451c82['error'][_0x226f('0x15')]);return _0x15d0a1(_0x451c82[_0x226f('0x13')][_0x226f('0x15')]);}logger[_0x226f('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x2f37be,_0x451c82[_0x226f('0x13')]['message']);return _0x367ce2(_0x451c82[_0x226f('0x13')][_0x226f('0x15')]);}else{logger[_0x226f('0xe')](_0x226f('0xf'),_0x2f37be,_0x226f('0x10'));_0x367ce2(_0x451c82[_0x226f('0x16')][_0x226f('0x15')]);}})['catch'](function(_0x9324bd){logger[_0x226f('0x13')](_0x226f('0xf'),_0x2f37be,_0x9324bd);_0x15d0a1(_0x9324bd);});});}