Built motion from commit d1eab355.|2.6.28
[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 _0x94f7=['then','info','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0x94f7,0x1da));var _0x794f=function(_0x416c4c,_0x512b93){_0x416c4c=_0x416c4c-0x0;var _0x2259c7=_0x94f7[_0x416c4c];return _0x2259c7;};'use strict';var _=require(_0x794f('0x0'));var util=require(_0x794f('0x1'));var moment=require(_0x794f('0x2'));var BPromise=require(_0x794f('0x3'));var rs=require(_0x794f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x794f('0x5'));var logger=require(_0x794f('0x6'))('rpc');var config=require(_0x794f('0x7'));var jayson=require(_0x794f('0x8'));var client=jayson[_0x794f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8d742,_0x29f255,_0x140a25){return new BPromise(function(_0x5c665b,_0x398b3e){return client['request'](_0x8d742,_0x140a25)[_0x794f('0xa')](function(_0x6f4f55){logger[_0x794f('0xb')](_0x794f('0xc'),_0x29f255,'request\x20sent');logger[_0x794f('0xd')](_0x794f('0xe'),_0x29f255,'request\x20sent',JSON[_0x794f('0xf')](_0x6f4f55));if(_0x6f4f55[_0x794f('0x10')]){if(_0x6f4f55[_0x794f('0x10')][_0x794f('0x11')]===0x1f4){logger[_0x794f('0x10')](_0x794f('0xc'),_0x29f255,_0x6f4f55['error'][_0x794f('0x12')]);return _0x398b3e(_0x6f4f55['error'][_0x794f('0x12')]);}logger[_0x794f('0x10')](_0x794f('0xc'),_0x29f255,_0x6f4f55[_0x794f('0x10')][_0x794f('0x12')]);return _0x5c665b(_0x6f4f55[_0x794f('0x10')][_0x794f('0x12')]);}else{logger[_0x794f('0xb')](_0x794f('0xc'),_0x29f255,_0x794f('0x13'));_0x5c665b(_0x6f4f55[_0x794f('0x14')][_0x794f('0x12')]);}})[_0x794f('0x15')](function(_0x5b4083){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x29f255,_0x5b4083);_0x398b3e(_0x5b4083);});});}