Built motion from commit 52c8a02d.|2.6.29
[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 _0x2b7b=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x60655c,_0x22a0ec){var _0x16fe5c=function(_0x5b9d09){while(--_0x5b9d09){_0x60655c['push'](_0x60655c['shift']());}};_0x16fe5c(++_0x22a0ec);}(_0x2b7b,0x13e));var _0xb2b7=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x2b7b[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xb2b7('0x0'));var util=require(_0xb2b7('0x1'));var moment=require(_0xb2b7('0x2'));var BPromise=require(_0xb2b7('0x3'));var rs=require(_0xb2b7('0x4'));var fs=require('fs');var Redis=require(_0xb2b7('0x5'));var db=require(_0xb2b7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb2b7('0x7'));var config=require(_0xb2b7('0x8'));var jayson=require(_0xb2b7('0x9'));var client=jayson[_0xb2b7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4945df,_0x29ace2,_0x691a5b){return new BPromise(function(_0x4a22e7,_0x4183dc){return client[_0xb2b7('0xb')](_0x4945df,_0x691a5b)[_0xb2b7('0xc')](function(_0x2fef3f){logger[_0xb2b7('0xd')](_0xb2b7('0xe'),_0x29ace2,_0xb2b7('0xf'));logger['debug'](_0xb2b7('0x10'),_0x29ace2,_0xb2b7('0xf'),JSON[_0xb2b7('0x11')](_0x2fef3f));if(_0x2fef3f[_0xb2b7('0x12')]){if(_0x2fef3f[_0xb2b7('0x12')][_0xb2b7('0x13')]===0x1f4){logger[_0xb2b7('0x12')](_0xb2b7('0xe'),_0x29ace2,_0x2fef3f[_0xb2b7('0x12')][_0xb2b7('0x14')]);return _0x4183dc(_0x2fef3f[_0xb2b7('0x12')][_0xb2b7('0x14')]);}logger[_0xb2b7('0x12')](_0xb2b7('0xe'),_0x29ace2,_0x2fef3f[_0xb2b7('0x12')]['message']);return _0x4a22e7(_0x2fef3f[_0xb2b7('0x12')][_0xb2b7('0x14')]);}else{logger[_0xb2b7('0xd')](_0xb2b7('0xe'),_0x29ace2,_0xb2b7('0xf'));_0x4a22e7(_0x2fef3f[_0xb2b7('0x15')][_0xb2b7('0x14')]);}})[_0xb2b7('0x16')](function(_0x5b6ddc){logger['error'](_0xb2b7('0xe'),_0x29ace2,_0x5b6ddc);_0x4183dc(_0x5b6ddc);});});}