68d26d70b24172b355e6914440ad775fdcd9b084
[motion2.git] / server / api / cmContactHasItem / cmContactHasItem.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 _0xf6c6=['stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','request\x20sent'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf6c6,0xed));var _0x6f6c=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xf6c6[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x6f6c('0x0'));var util=require(_0x6f6c('0x1'));var moment=require(_0x6f6c('0x2'));var BPromise=require(_0x6f6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f6c('0x4'));var db=require(_0x6f6c('0x5'))['db'];var utils=require(_0x6f6c('0x6'));var logger=require(_0x6f6c('0x7'))('rpc');var config=require(_0x6f6c('0x8'));var jayson=require(_0x6f6c('0x9'));var client=jayson[_0x6f6c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x158508,_0x10d84e,_0x4bb100){return new BPromise(function(_0x53f5c4,_0x4e57d1){return client[_0x6f6c('0xb')](_0x158508,_0x4bb100)['then'](function(_0x16c39d){logger[_0x6f6c('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x10d84e,'request\x20sent');logger[_0x6f6c('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x10d84e,_0x6f6c('0xe'),JSON[_0x6f6c('0xf')](_0x16c39d));if(_0x16c39d[_0x6f6c('0x10')]){if(_0x16c39d[_0x6f6c('0x10')][_0x6f6c('0x11')]===0x1f4){logger[_0x6f6c('0x10')](_0x6f6c('0x12'),_0x10d84e,_0x16c39d[_0x6f6c('0x10')]['message']);return _0x4e57d1(_0x16c39d['error'][_0x6f6c('0x13')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x10d84e,_0x16c39d[_0x6f6c('0x10')][_0x6f6c('0x13')]);return _0x53f5c4(_0x16c39d[_0x6f6c('0x10')][_0x6f6c('0x13')]);}else{logger[_0x6f6c('0xc')](_0x6f6c('0x12'),_0x10d84e,_0x6f6c('0xe'));_0x53f5c4(_0x16c39d[_0x6f6c('0x14')][_0x6f6c('0x13')]);}})['catch'](function(_0xe76fe9){logger[_0x6f6c('0x10')](_0x6f6c('0x12'),_0x10d84e,_0xe76fe9);_0x4e57d1(_0xe76fe9);});});}