1b689163fb8b04562fb539674823a99ffb8e5a49
[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 _0x56cf=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x133319,_0x251e31){var _0x43c3c2=function(_0x1b96a7){while(--_0x1b96a7){_0x133319['push'](_0x133319['shift']());}};_0x43c3c2(++_0x251e31);}(_0x56cf,0x18a));var _0xf56c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf56c('0x0'));var util=require(_0xf56c('0x1'));var moment=require(_0xf56c('0x2'));var BPromise=require(_0xf56c('0x3'));var rs=require(_0xf56c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf56c('0x5'));var logger=require('../../config/logger')(_0xf56c('0x6'));var config=require(_0xf56c('0x7'));var jayson=require(_0xf56c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ceb15,_0x3c3142,_0x51df3a){return new BPromise(function(_0x51c212,_0x4d85e2){return client[_0xf56c('0x9')](_0x1ceb15,_0x51df3a)[_0xf56c('0xa')](function(_0x5d2958){logger[_0xf56c('0xb')](_0xf56c('0xc'),_0x3c3142,_0xf56c('0xd'));logger[_0xf56c('0xe')](_0xf56c('0xf'),_0x3c3142,_0xf56c('0xd'),JSON['stringify'](_0x5d2958));if(_0x5d2958[_0xf56c('0x10')]){if(_0x5d2958[_0xf56c('0x10')][_0xf56c('0x11')]===0x1f4){logger[_0xf56c('0x10')](_0xf56c('0xc'),_0x3c3142,_0x5d2958[_0xf56c('0x10')]['message']);return _0x4d85e2(_0x5d2958[_0xf56c('0x10')][_0xf56c('0x12')]);}logger[_0xf56c('0x10')](_0xf56c('0xc'),_0x3c3142,_0x5d2958[_0xf56c('0x10')][_0xf56c('0x12')]);return _0x51c212(_0x5d2958['error']['message']);}else{logger['info'](_0xf56c('0xc'),_0x3c3142,'request\x20sent');_0x51c212(_0x5d2958[_0xf56c('0x13')][_0xf56c('0x12')]);}})[_0xf56c('0x14')](function(_0x4b6139){logger[_0xf56c('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x3c3142,_0x4b6139);_0x4d85e2(_0x4b6139);});});}