77dad1789482719eb01279f04a0ba793e878939e
[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 _0x34f0=['request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','info','CmContactHasItem,\x20%s,\x20%s'];(function(_0x9b0976,_0x40dab4){var _0x5362d5=function(_0xb5fde1){while(--_0xb5fde1){_0x9b0976['push'](_0x9b0976['shift']());}};_0x5362d5(++_0x40dab4);}(_0x34f0,0xfb));var _0x034f=function(_0x25bacf,_0x1f9cc3){_0x25bacf=_0x25bacf-0x0;var _0x3849f0=_0x34f0[_0x25bacf];return _0x3849f0;};'use strict';var _=require(_0x034f('0x0'));var util=require(_0x034f('0x1'));var moment=require(_0x034f('0x2'));var BPromise=require(_0x034f('0x3'));var rs=require(_0x034f('0x4'));var fs=require('fs');var Redis=require(_0x034f('0x5'));var db=require(_0x034f('0x6'))['db'];var utils=require(_0x034f('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x034f('0x8'));var client=jayson['client'][_0x034f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14d8f8,_0x38d7bf,_0x415908){return new BPromise(function(_0xfbbb7a,_0x4d3cc8){return client[_0x034f('0xa')](_0x14d8f8,_0x415908)['then'](function(_0x3c66e7){logger[_0x034f('0xb')](_0x034f('0xc'),_0x38d7bf,_0x034f('0xd'));logger[_0x034f('0xe')](_0x034f('0xf'),_0x38d7bf,_0x034f('0xd'),JSON[_0x034f('0x10')](_0x3c66e7));if(_0x3c66e7[_0x034f('0x11')]){if(_0x3c66e7[_0x034f('0x11')][_0x034f('0x12')]===0x1f4){logger[_0x034f('0x11')](_0x034f('0xc'),_0x38d7bf,_0x3c66e7['error'][_0x034f('0x13')]);return _0x4d3cc8(_0x3c66e7[_0x034f('0x11')][_0x034f('0x13')]);}logger['error'](_0x034f('0xc'),_0x38d7bf,_0x3c66e7[_0x034f('0x11')][_0x034f('0x13')]);return _0xfbbb7a(_0x3c66e7['error']['message']);}else{logger[_0x034f('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x38d7bf,_0x034f('0xd'));_0xfbbb7a(_0x3c66e7[_0x034f('0x14')][_0x034f('0x13')]);}})[_0x034f('0x15')](function(_0x33ec97){logger[_0x034f('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x38d7bf,_0x33ec97);_0x4d3cc8(_0x33ec97);});});}