Built motion from commit e6806ed6.|2.6.0
[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 _0x7f60=['CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x177c73,_0x2a4cd8){var _0x144750=function(_0x19f459){while(--_0x19f459){_0x177c73['push'](_0x177c73['shift']());}};_0x144750(++_0x2a4cd8);}(_0x7f60,0x16c));var _0x07f6=function(_0x414e10,_0x5ccd93){_0x414e10=_0x414e10-0x0;var _0x50fe59=_0x7f60[_0x414e10];return _0x50fe59;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x07f6('0x0'));var rs=require(_0x07f6('0x1'));var fs=require('fs');var Redis=require(_0x07f6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x07f6('0x3'));var logger=require(_0x07f6('0x4'))(_0x07f6('0x5'));var config=require(_0x07f6('0x6'));var jayson=require(_0x07f6('0x7'));var client=jayson[_0x07f6('0x8')][_0x07f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x297815,_0x41a311,_0x151103){return new BPromise(function(_0x20f94d,_0x1f5970){return client['request'](_0x297815,_0x151103)['then'](function(_0x14b4db){logger[_0x07f6('0xa')](_0x07f6('0xb'),_0x41a311,_0x07f6('0xc'));logger[_0x07f6('0xd')](_0x07f6('0xe'),_0x41a311,_0x07f6('0xc'),JSON[_0x07f6('0xf')](_0x14b4db));if(_0x14b4db[_0x07f6('0x10')]){if(_0x14b4db[_0x07f6('0x10')][_0x07f6('0x11')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x41a311,_0x14b4db[_0x07f6('0x10')][_0x07f6('0x12')]);return _0x1f5970(_0x14b4db[_0x07f6('0x10')][_0x07f6('0x12')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x41a311,_0x14b4db[_0x07f6('0x10')][_0x07f6('0x12')]);return _0x20f94d(_0x14b4db['error']['message']);}else{logger[_0x07f6('0xa')](_0x07f6('0xb'),_0x41a311,'request\x20sent');_0x20f94d(_0x14b4db[_0x07f6('0x13')][_0x07f6('0x12')]);}})[_0x07f6('0x14')](function(_0x308dce){logger['error'](_0x07f6('0xb'),_0x41a311,_0x308dce);_0x1f5970(_0x308dce);});});}