79e844c7c969a60d402c89eee9cc82857c5a478d
[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 _0x2f03=['info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x33731b,_0x43f896){var _0x3dd194=function(_0x3520ed){while(--_0x3520ed){_0x33731b['push'](_0x33731b['shift']());}};_0x3dd194(++_0x43f896);}(_0x2f03,0x10d));var _0x32f0=function(_0x5786f4,_0x3fb36b){_0x5786f4=_0x5786f4-0x0;var _0x273c37=_0x2f03[_0x5786f4];return _0x273c37;};'use strict';var _=require(_0x32f0('0x0'));var util=require(_0x32f0('0x1'));var moment=require(_0x32f0('0x2'));var BPromise=require(_0x32f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x32f0('0x4'));var logger=require(_0x32f0('0x5'))('rpc');var config=require(_0x32f0('0x6'));var jayson=require(_0x32f0('0x7'));var client=jayson[_0x32f0('0x8')][_0x32f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13a587,_0x4e93c5,_0x29458f){return new BPromise(function(_0x58c39e,_0x217317){return client[_0x32f0('0xa')](_0x13a587,_0x29458f)['then'](function(_0xc7bee6){logger[_0x32f0('0xb')](_0x32f0('0xc'),_0x4e93c5,_0x32f0('0xd'));logger[_0x32f0('0xe')](_0x32f0('0xf'),_0x4e93c5,_0x32f0('0xd'),JSON['stringify'](_0xc7bee6));if(_0xc7bee6[_0x32f0('0x10')]){if(_0xc7bee6[_0x32f0('0x10')]['code']===0x1f4){logger['error'](_0x32f0('0xc'),_0x4e93c5,_0xc7bee6['error'][_0x32f0('0x11')]);return _0x217317(_0xc7bee6[_0x32f0('0x10')][_0x32f0('0x11')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x4e93c5,_0xc7bee6['error'][_0x32f0('0x11')]);return _0x58c39e(_0xc7bee6[_0x32f0('0x10')][_0x32f0('0x11')]);}else{logger[_0x32f0('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x4e93c5,'request\x20sent');_0x58c39e(_0xc7bee6[_0x32f0('0x12')]['message']);}})[_0x32f0('0x13')](function(_0x5d6dfc){logger[_0x32f0('0x10')](_0x32f0('0xc'),_0x4e93c5,_0x5d6dfc);_0x217317(_0x5d6dfc);});});}