Built motion from commit 85328c08.|2.5.50
[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 _0x636f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4920e6,_0x398107){var _0x845c60=function(_0x9079c4){while(--_0x9079c4){_0x4920e6['push'](_0x4920e6['shift']());}};_0x845c60(++_0x398107);}(_0x636f,0xe3));var _0xf636=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x636f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf636('0x0'));var util=require(_0xf636('0x1'));var moment=require(_0xf636('0x2'));var BPromise=require('bluebird');var rs=require(_0xf636('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf636('0x4'))['db'];var utils=require(_0xf636('0x5'));var logger=require(_0xf636('0x6'))(_0xf636('0x7'));var config=require(_0xf636('0x8'));var jayson=require(_0xf636('0x9'));var client=jayson[_0xf636('0xa')][_0xf636('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1340b9,_0x8cfd12,_0x5e3497){return new BPromise(function(_0x2a2759,_0x4c3cfd){return client['request'](_0x1340b9,_0x5e3497)[_0xf636('0xc')](function(_0x1f6d5d){logger[_0xf636('0xd')](_0xf636('0xe'),_0x8cfd12,_0xf636('0xf'));logger[_0xf636('0x10')](_0xf636('0x11'),_0x8cfd12,_0xf636('0xf'),JSON[_0xf636('0x12')](_0x1f6d5d));if(_0x1f6d5d[_0xf636('0x13')]){if(_0x1f6d5d[_0xf636('0x13')][_0xf636('0x14')]===0x1f4){logger['error'](_0xf636('0xe'),_0x8cfd12,_0x1f6d5d['error'][_0xf636('0x15')]);return _0x4c3cfd(_0x1f6d5d[_0xf636('0x13')][_0xf636('0x15')]);}logger[_0xf636('0x13')](_0xf636('0xe'),_0x8cfd12,_0x1f6d5d['error'][_0xf636('0x15')]);return _0x2a2759(_0x1f6d5d['error'][_0xf636('0x15')]);}else{logger['info'](_0xf636('0xe'),_0x8cfd12,'request\x20sent');_0x2a2759(_0x1f6d5d['result']['message']);}})[_0xf636('0x16')](function(_0x44b351){logger[_0xf636('0x13')](_0xf636('0xe'),_0x8cfd12,_0x44b351);_0x4c3cfd(_0x44b351);});});}