Built motion from commit (unavailable).|2.5.6
[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 _0x9a08=['stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x227904,_0x566709){var _0x58eaba=function(_0x5bd156){while(--_0x5bd156){_0x227904['push'](_0x227904['shift']());}};_0x58eaba(++_0x566709);}(_0x9a08,0x186));var _0x89a0=function(_0x2bc2a2,_0x51e95f){_0x2bc2a2=_0x2bc2a2-0x0;var _0x20de67=_0x9a08[_0x2bc2a2];return _0x20de67;};'use strict';var _=require(_0x89a0('0x0'));var util=require(_0x89a0('0x1'));var moment=require(_0x89a0('0x2'));var BPromise=require(_0x89a0('0x3'));var rs=require(_0x89a0('0x4'));var fs=require('fs');var Redis=require(_0x89a0('0x5'));var db=require(_0x89a0('0x6'))['db'];var utils=require(_0x89a0('0x7'));var logger=require(_0x89a0('0x8'))('rpc');var config=require(_0x89a0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x89a0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20beaa,_0x344270,_0x5f5c02){return new BPromise(function(_0x3f8632,_0x31bf66){return client[_0x89a0('0xb')](_0x20beaa,_0x5f5c02)[_0x89a0('0xc')](function(_0x3b5892){logger[_0x89a0('0xd')](_0x89a0('0xe'),_0x344270,_0x89a0('0xf'));logger[_0x89a0('0x10')](_0x89a0('0x11'),_0x344270,_0x89a0('0xf'),JSON[_0x89a0('0x12')](_0x3b5892));if(_0x3b5892['error']){if(_0x3b5892['error'][_0x89a0('0x13')]===0x1f4){logger[_0x89a0('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x344270,_0x3b5892[_0x89a0('0x14')][_0x89a0('0x15')]);return _0x31bf66(_0x3b5892[_0x89a0('0x14')][_0x89a0('0x15')]);}logger[_0x89a0('0x14')](_0x89a0('0xe'),_0x344270,_0x3b5892[_0x89a0('0x14')]['message']);return _0x3f8632(_0x3b5892['error'][_0x89a0('0x15')]);}else{logger[_0x89a0('0xd')](_0x89a0('0xe'),_0x344270,'request\x20sent');_0x3f8632(_0x3b5892[_0x89a0('0x16')][_0x89a0('0x15')]);}})[_0x89a0('0x17')](function(_0x3819c8){logger[_0x89a0('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x344270,_0x3819c8);_0x31bf66(_0x3819c8);});});}