Built motion from commit (unavailable).|2.4.17
[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 _0x8358=['ChatProactiveAction,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x479cfe,_0x12c4cb){var _0x42580f=function(_0x42c73a){while(--_0x42c73a){_0x479cfe['push'](_0x479cfe['shift']());}};_0x42580f(++_0x12c4cb);}(_0x8358,0x1b4));var _0x8835=function(_0x36f803,_0x22f048){_0x36f803=_0x36f803-0x0;var _0x3f27b6=_0x8358[_0x36f803];return _0x3f27b6;};'use strict';var _=require('lodash');var util=require(_0x8835('0x0'));var moment=require(_0x8835('0x1'));var BPromise=require(_0x8835('0x2'));var rs=require(_0x8835('0x3'));var fs=require('fs');var Redis=require(_0x8835('0x4'));var db=require(_0x8835('0x5'))['db'];var utils=require(_0x8835('0x6'));var logger=require(_0x8835('0x7'))(_0x8835('0x8'));var config=require(_0x8835('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8835('0xa')][_0x8835('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x283755,_0x5a29c2,_0x29dd39){return new BPromise(function(_0x36d5c6,_0x34bdec){return client[_0x8835('0xc')](_0x283755,_0x29dd39)[_0x8835('0xd')](function(_0x3ea9ac){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x5a29c2,_0x8835('0xe'));logger[_0x8835('0xf')](_0x8835('0x10'),_0x5a29c2,_0x8835('0xe'),JSON[_0x8835('0x11')](_0x3ea9ac));if(_0x3ea9ac['error']){if(_0x3ea9ac[_0x8835('0x12')][_0x8835('0x13')]===0x1f4){logger[_0x8835('0x12')](_0x8835('0x14'),_0x5a29c2,_0x3ea9ac[_0x8835('0x12')][_0x8835('0x15')]);return _0x34bdec(_0x3ea9ac[_0x8835('0x12')][_0x8835('0x15')]);}logger[_0x8835('0x12')](_0x8835('0x14'),_0x5a29c2,_0x3ea9ac[_0x8835('0x12')][_0x8835('0x15')]);return _0x36d5c6(_0x3ea9ac[_0x8835('0x12')][_0x8835('0x15')]);}else{logger[_0x8835('0x16')](_0x8835('0x14'),_0x5a29c2,_0x8835('0xe'));_0x36d5c6(_0x3ea9ac['result'][_0x8835('0x15')]);}})[_0x8835('0x17')](function(_0x21cd15){logger[_0x8835('0x12')](_0x8835('0x14'),_0x5a29c2,_0x21cd15);_0x34bdec(_0x21cd15);});});}