Built motion from commit 9d0783e6.|2.6.13
[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 _0x8f3b=['ioredis','../../config/logger','rpc','jayson/promise','http','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','moment','randomstring'];(function(_0x519027,_0x26636d){var _0x1a6f9e=function(_0x2ad431){while(--_0x2ad431){_0x519027['push'](_0x519027['shift']());}};_0x1a6f9e(++_0x26636d);}(_0x8f3b,0x1d9));var _0xb8f3=function(_0x2b7fa5,_0x222569){_0x2b7fa5=_0x2b7fa5-0x0;var _0x33bb32=_0x8f3b[_0x2b7fa5];return _0x33bb32;};'use strict';var _=require(_0xb8f3('0x0'));var util=require('util');var moment=require(_0xb8f3('0x1'));var BPromise=require('bluebird');var rs=require(_0xb8f3('0x2'));var fs=require('fs');var Redis=require(_0xb8f3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb8f3('0x4'))(_0xb8f3('0x5'));var config=require('../../config/environment');var jayson=require(_0xb8f3('0x6'));var client=jayson['client'][_0xb8f3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cb9e8,_0x2dec4e,_0x581845){return new BPromise(function(_0x2f375f,_0x45238e){return client[_0xb8f3('0x8')](_0x4cb9e8,_0x581845)['then'](function(_0x306ad4){logger['info'](_0xb8f3('0x9'),_0x2dec4e,_0xb8f3('0xa'));logger['debug'](_0xb8f3('0xb'),_0x2dec4e,_0xb8f3('0xa'),JSON['stringify'](_0x306ad4));if(_0x306ad4[_0xb8f3('0xc')]){if(_0x306ad4['error'][_0xb8f3('0xd')]===0x1f4){logger['error'](_0xb8f3('0x9'),_0x2dec4e,_0x306ad4[_0xb8f3('0xc')]['message']);return _0x45238e(_0x306ad4[_0xb8f3('0xc')]['message']);}logger[_0xb8f3('0xc')](_0xb8f3('0x9'),_0x2dec4e,_0x306ad4[_0xb8f3('0xc')][_0xb8f3('0xe')]);return _0x2f375f(_0x306ad4[_0xb8f3('0xc')]['message']);}else{logger[_0xb8f3('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x2dec4e,_0xb8f3('0xa'));_0x2f375f(_0x306ad4['result'][_0xb8f3('0xe')]);}})[_0xb8f3('0x10')](function(_0x256605){logger[_0xb8f3('0xc')](_0xb8f3('0x9'),_0x2dec4e,_0x256605);_0x45238e(_0x256605);});});}